* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Acp/Ui/Page/Menu
*/
-define(['Dictionary'], function(Dictionary) {
+define(['Dictionary', 'EventHandler'], function(Dictionary, EventHandler) {
"use strict";
var _activeMenuItem = '';
_activeMenuItem = menuItem;
}
+
+ EventHandler.fire('com.woltlab.wcf.AcpMenu', 'resize');
}
};
});
var _stylePreviewRegions = new Dictionary();
var _stylePreviewRegionMarker = null;
+ var _isVisible = true;
+ var _updateRegionMarker = null;
+
/**
* @module WoltLabSuite/Core/Acp/Ui/Style/Editor
*/
- var AcpUiStyleEditor = {
+ return {
/**
* Sets up dynamic style options.
*/
unmatch: this.showVisualEditor.bind(this),
setup: this.hideVisualEditor.bind(this)
});
+
+ var callbackRegionMarker = function () {
+ if (_isVisible) _updateRegionMarker();
+ };
+ window.addEventListener('resize', callbackRegionMarker);
+ EventHandler.add('com.woltlab.wcf.AcpMenu', 'resize', callbackRegionMarker);
+ EventHandler.add('com.woltlab.wcf.simpleTabMenu_styleTabMenuContainer', 'select', function (data) {
+ _isVisible = (data.activeName == 'colors');
+ callbackRegionMarker();
+ });
},
/**
var select = elById('spCategories');
var lastValue = select.value;
- function updateRegionMarker() {
+ _updateRegionMarker = function() {
if (lastValue === 'none') {
elHide(_stylePreviewRegionMarker);
updateWrapperPosition(null);
updateWrapperPosition(region);
scrollToRegion(top);
- }
+ };
var variablesWrapper = elById('spVariablesWrapper');
function updateWrapperPosition(region) {
elShow(element);
// set region marker
- updateRegionMarker();
+ _updateRegionMarker();
selectContainer.classList[(lastValue === 'none' ? 'remove' : 'add')]('pointer');
});
}, 100);
}
};
-
- return AcpUiStyleEditor;
});