This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/assets/javascripts/page_edit.js.erb

55 lines
1.5 KiB
Plaintext

$("div.editable").live("mouseenter mouseleave", function (event) {
$(this).children('.edit_link').toggle();
});
$("#page_design").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
});
$("#page_module_app_id").live('change', function() {
var app_id = $(this).val();
if(app_id!=''){
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_frontend_pages',function(data, textStatus){
if(textStatus == 'success'){
$(this).after(data);
}
});
}
else{
$("#app_page_url").children().remove();
}
});
$("#module_app_list select").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widgets');
});
$("#tag_list select").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_r_tag_options');
});
$('.part_kind').live('click', function() {
$('.part_kind_partial').hide();
$('#part_' + $(this).attr('value')).show();
});
$(document).ready(function(){
$('ol.sortable').nestedSortable({
disableNesting: 'no-nest',
forcePlaceholderSize: true,
handle: 'i',
helper: 'clone',
items: 'li',
maxLevels: 3,
opacity: .5,
placeholder: 'placeholder',
revert: 250,
tabSize: 25,
tolerance: 'pointer',
toleranceElement: '> div',
stop: function(event, ui) {
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: ui.item.parent().closest('li').attr('id'), position: ui.item.index() } );
}
});
});