Skip to content

Commit

Permalink
Some UX tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Apr 21, 2018
1 parent bde2f3d commit e94e7db
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 33 deletions.
2 changes: 1 addition & 1 deletion assets/admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/admin.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 17 additions & 18 deletions assets/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ jQuery( function ( $ ) {
if ( ! message ) {
return;
}
$( '#sfp-skins-notice' ).html( '<div id="sfp-skins-notice-message">' + message + '</div>' ).fadeIn( 250 );
$( '#sfp-skins-notice' )
.html( '<div id="sfp-skins-notice-message">' + message + '</div>' )
.fadeIn( 250 );

setTimeout( function () {
return $( '#sfp-skins-notice' ).html( '' ).fadeOut( 250 );
}, 2000 );
}, 2500 );

};

sfpSkins.getSkinValues = function () {
Expand Down Expand Up @@ -151,21 +155,6 @@ jQuery( function ( $ ) {
sfpSkins.notice( 'Skin Saved' );
} );

sfpSkins.$skinApplyConfirmDialog.find( '.button-primary' ).click( function () {
$.each( sfpSkins.$skinApplyConfirmDialog.data( 'settings' ), function ( setID, value ) {
var settingId;
settingId = 'string' === typeof sfpSkins.settingsMaps[setID] ? sfpSkins.settingsMaps[setID] : sfpSkins.settingsMaps[setID + ']'];
if ( settingId ) {
sfpSkins.set( settingId, value );
} else {
console.log( 'Couldn\'t find setting for ' + setID );
}
return void 0;
} );
sfpSkins.$skinApplyConfirmDialog.hide();
return sfpSkins.notice( 'Skin applied.' );
} );

sfpSkins.$orle.click( sfpSkins.closeSaveDlg );

sfpSkins.$wrap.click( function ( e ) {
Expand Down Expand Up @@ -214,7 +203,17 @@ jQuery( function ( $ ) {
applySkin: function ( skn ) {
$appWrap.fadeOut();
if ( skn ) {
sfpSkins.$skinApplyConfirmDialog.data( 'skin', skn.name ).data( 'settings', skn.data ).show().find( '.skin-name' ).html( skn.name );
$.each( skn.data, function ( setID, value ) {
var settingId;
settingId = 'string' === typeof sfpSkins.settingsMaps[setID] ? sfpSkins.settingsMaps[setID] : sfpSkins.settingsMaps[setID + ']'];
if ( settingId ) {
sfpSkins.set( settingId, value );
} else {
console.log( 'Couldn\'t find setting for ' + setID );
}
return void 0;
} );
return sfpSkins.notice( 'Loading skin preview...' );
}
}
},
Expand Down
Loading

0 comments on commit e94e7db

Please sign in to comment.