diff --git a/app/assets/javascripts/lib/items/items.js.erb b/app/assets/javascripts/lib/items/items.js.erb index 0900fab00..46b1fa050 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) {