From 9d7af2ccac5e88eb3a963209425bcc2da0ddec42 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 5 Nov 2013 16:47:44 +0800 Subject: [PATCH] fixed the edit link problem in site settings --- app/assets/javascripts/lib/items/items.js.erb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/lib/items/items.js.erb b/app/assets/javascripts/lib/items/items.js.erb index 0900fab0..46b1fa05 100644 --- a/app/assets/javascripts/lib/items/items.js.erb +++ b/app/assets/javascripts/lib/items/items.js.erb @@ -81,7 +81,7 @@ function customOpenSlide() { } else { $('#pageslide form').prop('method', 'post') }; - _type == 'page' ? pageSetting(element.data('id'), _edit) : linkSetting(element.data('id'), _edit); + _type == 'page' ? pageSetting(element.data('id'), _edit) : linkSetting(element.data('id'), _edit, pageslide); } }); $iFrame.pageslide({ @@ -237,8 +237,8 @@ function pageSetting(id, edit) { }; }; -function linkSetting(id, edit) { - $linkPublishedTrue = $('#link_is_published_true'); +function linkSetting(id, edit, ps) { + $linkPublishedTrue = ps.find('#link_is_published_true'); _status = edit; if(_status) { $.ajax({ @@ -250,6 +250,7 @@ function linkSetting(id, edit) { }) .done(function(data) { _linkData = data; + console.log($linkPublishedTrue) data.public ? $linkPublishedTrue.prop('checked', true) : $linkPublishedTrue.prop('checked', false); $linkPublishedTrue.prop('checked') ? $('.link-options').slideDown(300) : $('.link-options').slideUp(300); $.each(_linkData.link, function(index, val) {