From bb2a315df93c173db84d2d6fc0cf1b2bdbd931a7 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 30 Jul 2016 18:40:08 -0400 Subject: refactor site dialogs and add site editing --- data/assets/js/admin/tabs/sites.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'data/assets/js/admin/tabs') diff --git a/data/assets/js/admin/tabs/sites.js b/data/assets/js/admin/tabs/sites.js index 8644705..1ed7b48 100644 --- a/data/assets/js/admin/tabs/sites.js +++ b/data/assets/js/admin/tabs/sites.js @@ -81,11 +81,12 @@ jQuery(function($) { })); }).done(function(r) { list.html($.map(r, function(row) { - var active = (row.is_active == '1'); + var is_default = !!+row.is_default; return TEMPLATES.run('site', $.extend({}, row, { q: [row.site_id, row.slug, row.name, row.body].join(' ').toLowerCase(), - badge_css: +row.is_default ? '' : 'hidden', + badge_css: is_default ? '' : 'hidden', + css: is_default ? 'list-group-item-warning' : '', })); }).join('')); @@ -108,9 +109,8 @@ jQuery(function($) { $('#sites .active').removeClass('active'); $(this).addClass('active'); - // TODO - // $('#site-edit-dialog').data('site_id', site_id).modal('show'); - alert('TODO: edit site ' + site_id); + // show dialog + $('#site-edit-dialog').data('site_id', site_id).modal('show'); // stop event return false; -- cgit v1.2.3