/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/web/mage/redirect-url.js
51 строка
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
11 ноя 2025, 17:53
11 ноя 2025, 17:53
f22b64f
Код
Авторство
О чём код?
/** * Copyright 2014 Adobe * All Rights Reserved. */ define([ 'jquery', 'jquery-ui-modules/widget' ], function ($) { 'use strict'; $.widget('mage.redirectUrl', { options: { event: 'click', url: undefined }, /** * This method binds elements found in this widget. * @private */ _bind: function () { var handlers = {}; handlers[this.options.event] = '_onEvent'; this._on(handlers); }, /** * This method constructs a new widget. * @private */ _create: function () { this._bind(); }, /** * This method set the url for the redirect. * @private */ _onEvent: function () { if (this.options.url) { location.href = this.options.url; } else { location.href = this.element.val(); } } }); return $.mage.redirectUrl; });