aboutsummaryrefslogtreecommitdiff
path: root/data/assets/js/admin/dialogs/page-edit.js
blob: 05d69a77a2f83752171d6bb682feeb0c6f33c6d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
jQuery(function($) {
  "use strict";

  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;
  });
});