jumping menus updated..

This commit is contained in:
Harry Bomrah 2012-11-29 16:46:33 +08:00 committed by chris
parent 6426fb74d9
commit ee830f148e
2 changed files with 6 additions and 5 deletions

View File

@ -107,7 +107,9 @@ var orbitDesktop = function(dom){
$('body').on({ $('body').on({
click: function(){ click: function(){
if(!$(this).hasClass('active')){
o.sub_menu_item($(this)); o.sub_menu_item($(this));
}
return false; return false;
}, },
mouseenter: function(){ mouseenter: function(){
@ -261,7 +263,6 @@ var orbitDesktop = function(dom){
} }
} }
this.sub_menu_item = function(dom){ this.sub_menu_item = function(dom){
if(!dom.hasClass('active')){
var sub_data_method = dom.attr('callback-method'); var sub_data_method = dom.attr('callback-method');
if(sub_data_method){ if(sub_data_method){
$("div[container=true]").load(dom.attr("href"),function(){ $("div[container=true]").load(dom.attr("href"),function(){
@ -279,7 +280,6 @@ var orbitDesktop = function(dom){
$('*[content-type=menu] a').removeClass('thmc1 thmtxt active'); $('*[content-type=menu] a').removeClass('thmc1 thmtxt active');
dom.addClass('thmc1 thmtxt active'); dom.addClass('thmc1 thmtxt active');
} }
}
this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles
if(!target)target = "desktop"; if(!target)target = "desktop";

View File

@ -54,14 +54,15 @@ class Desktop::JournalPagesController < ApplicationController
def update def update
params[:writing_journal][:update_user_id] = current_user.id params[:writing_journal][:update_user_id] = current_user.id
@writing_journal= WritingJournal.find(params[:id]) @writing_journal= WritingJournal.find(params[:id])
respond_to do |format| # @writing_journal.update_user_id = current_user.id
if @writing_journal.update_attributes(params[:writing_journal]) if @writing_journal.update_attributes(params[:writing_journal])
render json: {success: true, msg: t('update.success.paper')}.to_json render json: {success: true, msg: t('update.success.paper')}.to_json
else else
error_msg = @writing_journal.errors.full_messages.join("<br />") error_msg = @writing_journal.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json render json: {success: false, msg: error_msg}.to_json
end end
end
end end
def check_file_type file def check_file_type file