From ed251dd226e86c9e9e35a64d9a3137048dc7c00f Mon Sep 17 00:00:00 2001 From: Pavel Sysolyatin Date: Tue, 13 Jan 2015 16:12:39 +0600 Subject: [PATCH] Ability to disable dropdown without destroy it. --- src/definitions/modules/dropdown.js | 4 ++-- src/definitions/modules/dropdown.less | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index fe023fcac..217b2c05e 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -219,7 +219,7 @@ $.fn.dropdown = function(parameters) { ? callback : function(){} ; - if( !module.is.active() && !module.is.allFiltered() ) { + if( module.can.show() && !module.is.active() && !module.is.allFiltered() ) { module.debug('Showing dropdown'); module.animate.show(function() { if( module.can.click() ) { @@ -1635,4 +1635,4 @@ $.extend( $.easing, { }); -})( jQuery, window , document ); \ No newline at end of file +})( jQuery, window , document ); diff --git a/src/definitions/modules/dropdown.less b/src/definitions/modules/dropdown.less index e84b24a82..f65aade1f 100755 --- a/src/definitions/modules/dropdown.less +++ b/src/definitions/modules/dropdown.less @@ -439,6 +439,16 @@ select.ui.dropdown { box-shadow: @selectionHoverBoxShadow; } +/* Disabled */ +.ui.selection.dropdown.disabled, +.ui.selection.dropdown.disabled:hover { + cursor: default; + box-shadow: none; + color: @selectionTextColor; + border: @selectionBorder; + opacity: 0.3 !important; +} + /* Visible Hover */ .ui.selection.visible.dropdown:hover { border-color: @selectionVisibleHoverBorderColor;