From 4f88b1a6269647e9614481878cffb868e11f5bc8 Mon Sep 17 00:00:00 2001 From: peterd Date: Wed, 4 Feb 2015 15:50:37 +0100 Subject: [PATCH] demo update --- index.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index a67ad0c..a27cbf0 100644 --- a/index.html +++ b/index.html @@ -294,11 +294,16 @@ window.myColorPicker = $('input.color').colorPicker({ var that = this; $elm.append('
'); - // $(document).on('click', '.trigger', function(e) { - // if (e.target === this && $(this).hasClass('active')) { - // that.toggle(false); - // } - // }) + $('.trigger').on('click', function(e) { + if (e.target === this && $(this).hasClass('active')) { + if (typeof e.stopPropagation != "undefined") { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } + that.toggle(); + } + }) }, cssAddon: // could also be in a css file instead