diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index f66eacb4..ee390441 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -107,7 +107,9 @@ var orbitDesktop = function(dom){ $('body').on({ click: function(){ - o.sub_menu_item($(this)); + if(!$(this).hasClass('active')){ + o.sub_menu_item($(this)); + } return false; }, mouseenter: function(){ @@ -261,7 +263,6 @@ var orbitDesktop = function(dom){ } } this.sub_menu_item = function(dom){ - if(!dom.hasClass('active')){ var sub_data_method = dom.attr('callback-method'); if(sub_data_method){ $("div[container=true]").load(dom.attr("href"),function(){ @@ -278,7 +279,6 @@ var orbitDesktop = function(dom){ } $('*[content-type=menu] a').removeClass('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 diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb index 69334a5b..5cf9c147 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -54,14 +54,16 @@ class Desktop::JournalPagesController < ApplicationController def update params[:writing_journal][:update_user_id] = current_user.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]) render json: {success: true, msg: "Paper successfully saved!"}.to_json + else error_msg = @writing_journal.errors.full_messages.join("
") render json: {success: false, msg: error_msg}.to_json end - end + end def check_file_type file