Merge pull request #8087 from shivapoudel/settings-api
Tweaks iris-picker styles
This commit is contained in:
commit
d2b99ebe5e
|
@ -2044,7 +2044,8 @@ img.help_tip {
|
|||
}
|
||||
|
||||
table.form-table {
|
||||
margin: 0 0 0;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
|
||||
.select2-container {
|
||||
display: block;
|
||||
|
@ -2121,21 +2122,17 @@ img.help_tip {
|
|||
}
|
||||
|
||||
.color_box {
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||
-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
padding: 4px 6px;
|
||||
float: left;
|
||||
width: 90px;
|
||||
padding: 4px 6px;
|
||||
margin: 0 10px 0 0;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
||||
|
||||
strong {
|
||||
text-align: left;
|
||||
display: block;
|
||||
text-align: left;
|
||||
padding: 0 0 2px;
|
||||
font-size: 0.92em;
|
||||
|
||||
|
@ -2146,8 +2143,8 @@ img.help_tip {
|
|||
}
|
||||
|
||||
input.colorpick {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
font-family: monospace;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
@ -2158,27 +2155,25 @@ img.help_tip {
|
|||
}
|
||||
|
||||
.color_box_clear {
|
||||
display: block;
|
||||
clear: both;
|
||||
display: block;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.iris-picker {
|
||||
z-index: 100;
|
||||
position: absolute;
|
||||
display: none;
|
||||
position: absolute;
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||
-webkit-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
|
||||
@include border-radius(3px);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
||||
|
||||
.ui-slider {
|
||||
border: 0 !important;
|
||||
background: none transparent !important;
|
||||
margin: 0 !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
background: none transparent !important;
|
||||
|
||||
.ui-slider-handle {
|
||||
margin-bottom: 0 !important;
|
||||
|
@ -2583,7 +2578,7 @@ img.help_tip {
|
|||
}
|
||||
}
|
||||
|
||||
h4.wc-settings-sub-title {
|
||||
h3.wc-settings-sub-title {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,92 +1,92 @@
|
|||
jQuery(window).load(function(){
|
||||
/* global woocommerce_settings_params */
|
||||
jQuery( window ).load( function() {
|
||||
|
||||
// Countries
|
||||
jQuery('select#woocommerce_allowed_countries, select#woocommerce_ship_to_countries').change(function(){
|
||||
if (jQuery(this).val()=="specific") {
|
||||
jQuery(this).parent().parent().next('tr').show();
|
||||
jQuery( 'select#woocommerce_allowed_countries, select#woocommerce_ship_to_countries' ).change( function() {
|
||||
if ( jQuery( this ).val() === 'specific' ) {
|
||||
jQuery( this ).parent().parent().next( 'tr' ).show();
|
||||
} else {
|
||||
jQuery(this).parent().parent().next('tr').hide();
|
||||
jQuery( this ).parent().parent().next( 'tr' ).hide();
|
||||
}
|
||||
}).change();
|
||||
|
||||
// Color picker
|
||||
jQuery('.colorpick').iris( {
|
||||
change: function(event, ui){
|
||||
jQuery(this).css( { backgroundColor: ui.color.toString() } );
|
||||
jQuery( '.colorpick' ).iris({
|
||||
change: function( event, ui ) {
|
||||
jQuery( this ).css({ backgroundColor: ui.color.toString() });
|
||||
},
|
||||
hide: true,
|
||||
border: true
|
||||
} ).each( function() {
|
||||
jQuery(this).css( { backgroundColor: jQuery(this).val() } );
|
||||
})
|
||||
.click(function(){
|
||||
jQuery('.iris-picker').hide();
|
||||
jQuery(this).closest('.color_box, td').find('.iris-picker').show();
|
||||
}).each( function() {
|
||||
jQuery( this ).css({ backgroundColor: jQuery( this ).val() });
|
||||
}).click( function() {
|
||||
jQuery( '.iris-picker' ).hide();
|
||||
jQuery( this ).closest( '.color_box, td' ).find( '.iris-picker' ).show();
|
||||
});
|
||||
|
||||
jQuery('body').click(function() {
|
||||
jQuery('.iris-picker').hide();
|
||||
jQuery( 'body' ).click( function() {
|
||||
jQuery( '.iris-picker' ).hide();
|
||||
});
|
||||
|
||||
jQuery('.color_box, .colorpick').click(function(event){
|
||||
event.stopPropagation();
|
||||
jQuery( '.color_box, .colorpick' ).click( function( event ) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Edit prompt
|
||||
jQuery(function(){
|
||||
jQuery( function() {
|
||||
var changed = false;
|
||||
|
||||
jQuery('input, textarea, select, checkbox').change(function(){
|
||||
jQuery( 'input, textarea, select, checkbox' ).change( function() {
|
||||
changed = true;
|
||||
});
|
||||
|
||||
jQuery('.woo-nav-tab-wrapper a').click(function(){
|
||||
if (changed) {
|
||||
jQuery( '.woo-nav-tab-wrapper a' ).click( function() {
|
||||
if ( changed ) {
|
||||
window.onbeforeunload = function() {
|
||||
return woocommerce_settings_params.i18n_nav_warning;
|
||||
}
|
||||
};
|
||||
} else {
|
||||
window.onbeforeunload = '';
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.submit input').click(function(){
|
||||
jQuery( '.submit input' ).click( function() {
|
||||
window.onbeforeunload = '';
|
||||
});
|
||||
});
|
||||
|
||||
// Sorting
|
||||
jQuery('table.wc_gateways tbody, table.wc_shipping tbody').sortable({
|
||||
items:'tr',
|
||||
cursor:'move',
|
||||
axis:'y',
|
||||
jQuery( 'table.wc_gateways tbody, table.wc_shipping tbody' ).sortable({
|
||||
items: 'tr',
|
||||
cursor: 'move',
|
||||
axis: 'y',
|
||||
handle: 'td.sort',
|
||||
scrollSensitivity:40,
|
||||
helper:function(e,ui){
|
||||
ui.children().each(function(){
|
||||
jQuery(this).width(jQuery(this).width());
|
||||
scrollSensitivity: 40,
|
||||
helper: function( event, ui ) {
|
||||
ui.children().each( function() {
|
||||
jQuery( this ).width( jQuery( this ).width() );
|
||||
});
|
||||
ui.css('left', '0');
|
||||
ui.css( 'left', '0' );
|
||||
return ui;
|
||||
},
|
||||
start:function(event,ui){
|
||||
ui.item.css('background-color','#f6f6f6');
|
||||
start: function( event, ui ) {
|
||||
ui.item.css( 'background-color', '#f6f6f6' );
|
||||
},
|
||||
stop:function(event,ui){
|
||||
ui.item.removeAttr('style');
|
||||
stop: function( event, ui ) {
|
||||
ui.item.removeAttr( 'style' );
|
||||
}
|
||||
});
|
||||
|
||||
// Select all/none
|
||||
jQuery( '.woocommerce' ).on( 'click', '.select_all', function() {
|
||||
jQuery(this).closest( 'td' ).find( 'select option' ).attr( "selected", "selected" );
|
||||
jQuery(this).closest( 'td' ).find('select').trigger( 'change' );
|
||||
jQuery( this ).closest( 'td' ).find( 'select option' ).attr( 'selected', 'selected' );
|
||||
jQuery( this ).closest( 'td' ).find( 'select' ).trigger( 'change' );
|
||||
return false;
|
||||
});
|
||||
|
||||
jQuery( '.woocommerce' ).on( 'click', '.select_none', function() {
|
||||
jQuery(this).closest( 'td' ).find( 'select option' ).removeAttr( "selected" );
|
||||
jQuery(this).closest( 'td' ).find('select').trigger( 'change' );
|
||||
jQuery( this ).closest( 'td' ).find( 'select option' ).removeAttr( 'selected' );
|
||||
jQuery( this ).closest( 'td' ).find( 'select' ).trigger( 'change' );
|
||||
return false;
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue