aboutsummaryrefslogtreecommitdiff
path: root/data/assets/js/admin/dialogs/page-edit.js
blob: 95c9a63bd2e7a3de181cd0bd343bf96c41053d65 (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
27
28
29
jQuery(function($) {
  "use strict";

  var p = '#page-edit-';

  $(p + 'dialog').on('guff.loaded', function(ev) {
    var r = ev.post_data;

    $(p + 'theme').val(r.theme_id || 'site-default');
  });

  $(p + 'confirm').click(function() {
    var theme_id = $(p + 'theme').val();
    if (theme_id == 'site-default')
      theme_id = null;

    $(p + 'dialog').trigger({
      type: 'guff.save',

      post_data: {
        have_theme_id: 't',
        theme_id: theme_id,
      },
    });

    // stop event
    return false;
  });
});