Permalink
Browse files

Consolidated internal refresh method into updateFromInput; removed fi…

…rstRun argument since it's no longer needed
  • Loading branch information...
1 parent a77485f commit c53b7a0c97a8208952550850cd5ada794be065d3 @claviska committed Aug 20, 2013
Showing with 4 additions and 12 deletions.
  1. +4 −12 jquery.minicolors.js
View
@@ -55,7 +55,7 @@ if(jQuery) (function($) {
} else {
// Setter
$(this).each( function() {
- refresh($(this).attr('data-opacity', data));
+ updateFromInput($(this).attr('data-opacity', data));
});
return $(this);
}
@@ -96,7 +96,7 @@ if(jQuery) (function($) {
} else {
// Setter
$(this).each( function() {
- refresh($(this).val(data));
+ updateFromInput($(this).val(data));
});
return $(this);
}
@@ -176,7 +176,7 @@ if(jQuery) (function($) {
// Inline controls
if( settings.inline ) input.parent().addClass('minicolors-inline');
- updateFromInput(input, false, true);
+ updateFromInput(input, false);
// Populate lastChange to prevent change event from firing initially
input.data('minicolors-lastChange', {
@@ -203,11 +203,6 @@ if(jQuery) (function($) {
}
- // Refresh the specified control
- function refresh(input) {
- updateFromInput(input);
- }
-
// Shows the specified dropdown panel
function show(input) {
@@ -469,7 +464,7 @@ if(jQuery) (function($) {
}
// Sets the color picker values from the input
- function updateFromInput(input, preserveInputValue, firstRun) {
+ function updateFromInput(input, preserveInputValue) {
var hex,
hsb,
@@ -596,9 +591,6 @@ if(jQuery) (function($) {
}
- // Handle change event
- if( !firstRun ) doChange(input, hex, opacity);
-
}
// Runs the change and changeDelay callbacks

0 comments on commit c53b7a0

Please sign in to comment.