Permalink
Browse files

prevent fadeOut for each ever opend panels

We have a side with many (40+) instances of this great MiniColors
plugin. After a while, when opening different instances it becomes very
slow.
  • Loading branch information...
1 parent 9be0b64 commit 43ec0c51f43604dd4da207255113d53fb39ae376 @mboehlke mboehlke committed Dec 20, 2013
Showing with 7 additions and 12 deletions.
  1. +7 −12 jquery.minicolors.js
View
@@ -227,19 +227,14 @@ if(jQuery) (function($) {
// Hides all dropdown panels
function hide() {
- $('.minicolors-input').each( function() {
-
- var input = $(this),
- settings = input.data('minicolors-settings'),
- minicolors = input.parent();
-
- // Don't hide inline controls
- if( settings.inline ) return;
-
+ $('.minicolors-focus').each( function() {
+
+ var minicolors = $(this),
+ input = minicolors.find('.minicolors-input'),
+ settings = input.data('minicolors-settings');
+
minicolors.find('.minicolors-panel').fadeOut(settings.hideSpeed, function() {
- if(minicolors.hasClass('minicolors-focus')) {
- if( settings.hide ) settings.hide.call(input.get(0));
- }
+ if( settings.hide ) settings.hide.call(input.get(0));
minicolors.removeClass('minicolors-focus');
});

0 comments on commit 43ec0c5

Please sign in to comment.