2010-08-27 15:40:03 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
2010-08-28 00:00:05 +00:00
|
|
|
var enableNav = function() {
|
|
|
|
$('#editable-elements .nav a').click(function(e) {
|
|
|
|
var index = parseInt($(this).attr('href').match(/block-(.+)/)[1]);
|
2010-08-27 15:40:03 +00:00
|
|
|
|
2010-08-28 00:00:05 +00:00
|
|
|
$('#editable-elements .wrapper ul li.block').hide();
|
2011-07-01 00:15:45 +00:00
|
|
|
$('#block-' + index).show().find('fieldset').trigger('refresh');
|
2010-08-27 15:40:03 +00:00
|
|
|
|
2010-08-28 00:00:05 +00:00
|
|
|
$(this).parent().find('.on').removeClass('on');
|
|
|
|
$(this).addClass('on');
|
2010-08-27 15:40:03 +00:00
|
|
|
|
2010-08-28 00:00:05 +00:00
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
enableNav();
|
|
|
|
|
|
|
|
$.subscribe('form.saved.success', function(event, data) {
|
|
|
|
if (data.editable_elements != '') {
|
|
|
|
$('#editable-elements').replaceWith(data.editable_elements);
|
|
|
|
enableNav();
|
2010-08-31 22:12:37 +00:00
|
|
|
|
|
|
|
$('textarea.html').tinymce(TinyMceDefaultSettings);
|
2010-08-28 00:00:05 +00:00
|
|
|
}
|
|
|
|
}, []);
|
2010-08-27 15:40:03 +00:00
|
|
|
|
2010-08-29 23:41:44 +00:00
|
|
|
$('textarea.html').tinymce(TinyMceDefaultSettings);
|
|
|
|
|
2010-08-27 15:40:03 +00:00
|
|
|
});
|