diff options
Diffstat (limited to 'data/assets/js/admin/dialogs/page-edit.js')
-rw-r--r-- | data/assets/js/admin/dialogs/page-edit.js | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/data/assets/js/admin/dialogs/page-edit.js b/data/assets/js/admin/dialogs/page-edit.js index 8af9ec2..05d69a7 100644 --- a/data/assets/js/admin/dialogs/page-edit.js +++ b/data/assets/js/admin/dialogs/page-edit.js @@ -1,7 +1,26 @@ jQuery(function($) { "use strict"; - $('#page-edit-dialog').on('post-data-loaded', function(r) { - console.log(r); + var p = '#page-edit-'; + + $(p + 'dialog').on('guff.loaded', function(ev) { + var r = ev.post_data; + + $(p + 'layout a').removeClass('btn-primary').addClass('btn-default'); + $(p + 'layout a[data-val="' + r.layout + '"]') + .toggleClass('btn-primary btn-default'); + }); + + $(p + 'confirm').click(function() { + $(p + 'dialog').trigger({ + type: 'guff.save', + + post_data: { + layout: $(p + 'layout .btn-primary').data('val'), + }, + }); + + // stop event + return false; }); }); |