From c758a064eb97b16fd875c9f5a624bb98f8a774dc Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 24 May 2016 12:00:43 -0400 Subject: add full editing, fts search --- data/assets/js/admin/dialogs/page-edit.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'data/assets/js/admin/dialogs/page-edit.js') 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; }); }); -- cgit v1.2.3