small fix for journal_pages desktop
This commit is contained in:
		
							parent
							
								
									0b9af044ba
								
							
						
					
					
						commit
						c53581c999
					
				|  | @ -207,15 +207,13 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ // | |||
|       } | ||||
|       bindHandlers(); | ||||
|     } | ||||
|     this.initializeJournalPapers.coAuthorformCallback = function(ruse){ | ||||
|       this.initializeJournalPapers.formCallback = function(data){ | ||||
|     this.initializeJournalPapers.coAuthorformCallback = function(data){ | ||||
|         if(data.success){ | ||||
|           o.notify(data.msg,"success"); | ||||
|           o.sub_menu_item($("div[content-type=menu] a").eq(0)); | ||||
|         }else{ | ||||
|           o.notify(data.msg,"alert"); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     this.initializeJournalPapers.coauthor = function(){ // to open add pages in journal papers page | ||||
|       var bindHandlers = function(){ // to bind handlers for add page | ||||
|  |  | |||
|  | @ -133,7 +133,7 @@ var orbitDesktop = function(dom){ | |||
|       } | ||||
|     },'*[content-type=menu] a'); | ||||
| 
 | ||||
|     $("body").on("submit","form[type=ajax_form]",function(){ | ||||
|     $("body").on("submit","form[form-type=ajax_form]",function(){ | ||||
|       var callback_method = $(this).attr("callback-method"); | ||||
|       var options = { | ||||
|         success:function(responseText, statusText, xhr, $form){ | ||||
|  |  | |||
|  | @ -35,18 +35,18 @@ class Desktop::JournalPagesController < ApplicationController | |||
|   end | ||||
| 
 | ||||
|   def create | ||||
|     if params[:commit].eql?"Save" | ||||
| 
 | ||||
|       params[:writing_journal][:create_user_id] = current_user.id | ||||
| 
 | ||||
|       @writing_journal = WritingJournal.new(params[:writing_journal]) | ||||
|       respond_to do |format| | ||||
|       if @writing_journal.save | ||||
|         format.json {render json: {success: true, msg: "Paper successfully saved!"}.to_json} | ||||
|       else | ||||
|         format.json {render json: {success: false, msg: "Saving failed!"}.to_json } | ||||
|         if @writing_journal.save | ||||
|           format.json {render json: {success: true, msg: "Paper successfully saved!"}.to_json} | ||||
|         else | ||||
|           format.json {render json: {success: false, msg: "Saving failed!"}.to_json } | ||||
|         end | ||||
|       end | ||||
|       end | ||||
|     end | ||||
|     | ||||
|   end | ||||
| 
 | ||||
|   def update | ||||
|  |  | |||
|  | @ -1,3 +1,3 @@ | |||
| <%= form_for @writing_journal, url: desktop_journal_page_path(@writing_journal),html: { multipart: true ,:type=>"ajax_form", "callback-method"=>"formCallback"}   do |f| %> | ||||
| <%= form_for @writing_journal, url: desktop_journal_page_path(@writing_journal),html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"formCallback"}   do |f| %> | ||||
|   <%= render partial: 'desktop/journal_pages/form', locals: {:f => f} %> | ||||
| <%end%> | ||||
|  |  | |||
|  | @ -1,3 +1,3 @@ | |||
| <%= form_for @writing_journal, html: { multipart: true, :type=>"ajax_form", "callback-method"=>"formCallback"} ,  url: desktop_journal_pages_path  do |f| %> | ||||
| <%= form_for @writing_journal, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"} ,  url: desktop_journal_pages_path  do |f| %> | ||||
|   <%= render partial: 'desktop/journal_pages/form', locals: {:f => f} %> | ||||
| <%end%> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue