From cd39d6a817fce1d3f6f9db8b0eec2cceda1bb3d6 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Fri, 15 Jan 2021 11:44:59 +0100 Subject: [PATCH] Use widget properties instead of hardcoded css classes in tab-container widget --- js/layouts/tab-container/tab-container.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/layouts/tab-container/tab-container.js b/js/layouts/tab-container/tab-container.js index 659fafd92..1168c70fb 100644 --- a/js/layouts/tab-container/tab-container.js +++ b/js/layouts/tab-container/tab-container.js @@ -27,7 +27,8 @@ $(function() css_classes: { is_hidden: 'ibo-is-hidden', - is_scrollable: 'ibo-is-scrollable' + is_scrollable: 'ibo-is-scrollable', + tab_container: 'ibo-tab-container', }, js_selectors: { @@ -44,7 +45,7 @@ $(function() _create: function() { var me = this; - this.element.addClass('ibo-tab-container'); + this.element.addClass(this.css_classes.tab_container); // Ugly patch for a change in the behavior of jQuery UI: // Before jQuery UI 1.9, tabs were always considered as "local" (opposed to Ajax) @@ -77,7 +78,7 @@ $(function() }, _addTabsWidget: function(aParams) { - if(this.element.hasClass('ibo-is-scrollable')){ + if(this.element.hasClass(this.css_classes.is_scrollable)){ this.element.scrollabletabs(aParams); } else { this.element.tabs(aParams); @@ -87,7 +88,7 @@ $(function() // revert other modifications here _destroy: function() { - this.element.removeClass('ibo-tab-container'); + this.element.removeClass(this.css_classes.tab_container); }, _bindEvents: function() {