Improve iris code

This commit is contained in:
Mike Jolley 2017-11-01 13:47:20 +00:00
parent 3e7eb3f8fe
commit 547bde0ceb
1 changed files with 16 additions and 15 deletions

View File

@ -34,23 +34,24 @@
}).change();
// Color picker
$( '.colorpick' ).iris({
change: function( event, ui ) {
$( this ).parent().find( '.colorpickpreview' ).css({ backgroundColor: ui.color.toString() });
},
hide: true,
border: true
}).click( function() {
$( '.iris-picker' ).hide();
$( this ).closest( 'td' ).find( '.iris-picker' ).show();
});
$( '.colorpick' )
$( 'body' ).click( function() {
$( '.iris-picker' ).hide();
});
.iris({
change: function( event, ui ) {
$( this ).parent().find( '.colorpickpreview' ).css({ backgroundColor: ui.color.toString() });
},
hide: true,
border: true
})
$( '.colorpick' ).click( function( event ) {
event.stopPropagation();
.on( 'click focus', function( event ) {
event.stopPropagation();
$( '.iris-picker' ).hide();
$( this ).closest( 'td' ).find( '.iris-picker' ).show();
});
$( 'body' ).on( 'click', function() {
$( '.iris-picker' ).hide();
});
// Edit prompt