diff --git a/app/assets/javascripts/desktop/orbitdesktop.js b/app/assets/javascripts/desktop/orbitdesktop.js index 0d6ed59fd..f45b8796f 100755 --- a/app/assets/javascripts/desktop/orbitdesktop.js +++ b/app/assets/javascripts/desktop/orbitdesktop.js @@ -226,7 +226,8 @@ var orbitDesktop = function(dom){ this.bindDesktopEvents = function(){ //this function will bind the global handlers to thd desktop, for example doc $(".docklist a").click(function(){ - o.menu_item($(this)); + if( !$( this ).hasClass( 'disable' ) ) + o.menu_item($(this)); return false; }); @@ -274,10 +275,11 @@ var orbitDesktop = function(dom){ }); $("body").on("click","*[ajax-remote]",function(){ - var $e = $(this); - var t = $e.attr("ajax-remote"); - var classes_to_toggle = $e.attr("toggle-onclick"); - var exe = $e.attr("callback-method"); // (typeof $e.attr("callback-method") == "function"? $e.attr("callback-method") : ""); + var $e = $(this), + t = $e.attr("ajax-remote"), + classes_to_toggle = $e.attr("toggle-onclick"), + responsetype = $e.attr('response-type') ? $e.attr('response-type') : "html", + exe = $e.attr("callback-method"); // (typeof $e.attr("callback-method") == "function"? $e.attr("callback-method") : ""); if(classes_to_toggle){ $e.toggleClass(classes_to_toggle); } @@ -289,9 +291,9 @@ var orbitDesktop = function(dom){ } var ca = $e.attr("content-holder"); var a = function(){ - $.ajax({ type : t, + dataType : responsetype, url : $e.attr("href"), success : function(data){ if(typeof data == "string"){ @@ -302,6 +304,7 @@ var orbitDesktop = function(dom){ // $("div[container=true]").html(data); } } + if(exe) window.o[o.data_method][exe](data,$e); if(t == "delete"){ diff --git a/app/views/desktop/index.html.erb b/app/views/desktop/index.html.erb index 9796ade73..cd3b6fcdb 100644 --- a/app/views/desktop/index.html.erb +++ b/app/views/desktop/index.html.erb @@ -32,32 +32,32 @@