Give widget color dialog unique class in order to identify it later for binding click handler to picker span.

-Fix the bug, color picker opens other colorpickers dialog which are in the same template.
This commit is contained in:
Hadi Nategh 2014-10-10 12:40:41 +00:00
parent e1b2df5609
commit b0e4655eff

View File

@ -138,13 +138,21 @@ var et2_color = et2_inputWidget.extend(
resizable: false,
width: "auto"
});
jQuery('table.jPicker').each(function(){
if (!this.getAttribute('class').match(/jPickerColorIden/))
{
//Add an identifier to dialog for later on to bind a click handler to it
//as jquery dialog has already an unique id, we make a unique class identifier with help of the widget id
jQuery(this).addClass('jPickerColorIden-'+self.id);
return false;
}
});
// Hide original move bar
jQuery('table.jPicker .Move').hide();
// Trigger dialog opening
jQuery('.Image',self.$node.next()).click(function() {
jQuery("table.jPicker").dialog("open");
jQuery("table.jPickerColorIden-"+self.id).dialog("open");
});
},500);
return true;