[Pkg-javascript-commits] [jquery-minicolors] 26/46: Fix swatch opacity on blur

David Prévot taffit at moszumanska.debian.org
Sun Oct 25 17:18:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository jquery-minicolors.

commit 0cb12ab3a622e3068b6e11d9e2336f4cc1ccc53b
Author: Cory LaViska <cory at abeautifulsite.net>
Date:   Thu Sep 17 16:42:03 2015 -0400

    Fix swatch opacity on blur
---
 jquery.minicolors.js     | 14 ++++++++++++--
 jquery.minicolors.min.js |  2 +-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/jquery.minicolors.js b/jquery.minicolors.js
index 7b64a6e..c06f882 100644
--- a/jquery.minicolors.js
+++ b/jquery.minicolors.js
@@ -942,7 +942,9 @@
             var input = $(this),
                 keywords = input.attr('data-keywords'),
                 settings = input.data('minicolors-settings'),
-                rgba;
+                rgba,
+                swatchOpacity;
+
             if( !input.data('minicolors-initialized') ) return;
 
             // Get array of lowercase keywords
@@ -952,7 +954,7 @@
 
             // Set color string
             if( input.val() !== '' && $.inArray(input.val().toLowerCase(), keywords) > -1 ) {
-                value = convertCase(input.val());
+                value = input.val();
             } else {
 
                 // Get RGBA values for easy conversion
@@ -973,6 +975,14 @@
 
             }
 
+            // Update swatch opacity
+            swatchOpacity = settings.opacity ? input.attr('data-opacity') : 1;
+            if( value.toLowerCase() === 'transparent' ) swatchOpacity = 0;
+            input
+                .closest('.minicolors')
+                .find('.minicolors-swatch > span')
+                .css('opacity', swatchOpacity);
+
             // Set input value
             input.val(value);
 
diff --git a/jquery.minicolors.min.js b/jquery.minicolors.min.js
index 665be36..5f961f8 100644
--- a/jquery.minicolors.min.js
+++ b/jquery.minicolors.min.js
@@ -8,4 +8,4 @@
  * @license: http://opensource.org/licenses/MIT
  *
  */
-!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function($){function i(i,t){var a=$('<div class="minicolors" />'),o=$.minicolors.defaults,s=i.attr("data-format"),n=i.attr("data-keywords"),e=i.attr("data-opacity");i.data("minicolors-initialized")||(t=$.extend(!0,{},o,t),a.addClass("minicolors-theme-"+t.theme).toggleClass("minicolors-with-opacity",t.opacity).toggleClass("minicolors-no-data-uris" [...]
\ No newline at end of file
+!function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function($){function i(i,t){var a=$('<div class="minicolors" />'),o=$.minicolors.defaults,s=i.attr("data-format"),n=i.attr("data-keywords"),e=i.attr("data-opacity");i.data("minicolors-initialized")||(t=$.extend(!0,{},o,t),a.addClass("minicolors-theme-"+t.theme).toggleClass("minicolors-with-opacity",t.opacity).toggleClass("minicolors-no-data-uris" [...]
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jquery-minicolors.git



More information about the Pkg-javascript-commits mailing list