diff options
author | mr <mr@mrautenberg.de> | 2011-03-15 16:39:22 +0100 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-03-15 16:39:22 +0100 |
commit | d8d49429f3d913fea56a631ac0a5b61c80916424 (patch) | |
tree | 4edb78e6d019fbc1906b712acf9ea1da5e2f2574 | |
parent | 422a5abc6c56f237d0bc84bce613e688867d0e16 (diff) |
clean toxcreate.js, fix cancel edit modelname / pt2
-rwxr-xr-x | public/javascripts/toxcreate.js | 6 | ||||
-rw-r--r-- | views/model_name.haml | 2 | ||||
-rw-r--r-- | views/model_name_edit.haml | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/public/javascripts/toxcreate.js b/public/javascripts/toxcreate.js index aea46f1..3f243fe 100755 --- a/public/javascripts/toxcreate.js +++ b/public/javascripts/toxcreate.js @@ -111,7 +111,7 @@ $(function() { }); -jQuery.fn.editModel = function(type, options) { +jQuery.fn.editModel = function(options) { var defaults = { method: 'get', action: this.attr('href'), @@ -138,7 +138,7 @@ jQuery.fn.editModel = function(type, options) { }); }; -jQuery.fn.cancelEdit = function(type, options) { +jQuery.fn.cancelEdit = function(options) { var defaults = { method: 'get', action: 'model/' + options.id + '/name?mode=show', @@ -165,7 +165,7 @@ jQuery.fn.cancelEdit = function(type, options) { }); }; -jQuery.fn.saveModel = function(type, options) { +jQuery.fn.saveModel = function(options) { var defaults = { method: 'put', action: 'model/' + options.id, diff --git a/views/model_name.haml b/views/model_name.haml index b1f6f10..91516ce 100644 --- a/views/model_name.haml +++ b/views/model_name.haml @@ -1,4 +1,4 @@ -- js = "$('#edit_#{model.id}').editModel('PUT', {id: '#{model.id}', mode: 'edit'});\n " +- js = "$('#edit_#{model.id}').editModel({id: '#{model.id}', mode: 'edit'});\n " :javascript $(function() { #{js} diff --git a/views/model_name_edit.haml b/views/model_name_edit.haml index a038996..d92c68a 100644 --- a/views/model_name_edit.haml +++ b/views/model_name_edit.haml @@ -1,5 +1,5 @@ -- js = "$('#cancel_#{model.id}').cancelEdit('GET', {id: '#{model.id}', mode: 'show'});\n " -- js += "$('#save_#{model.id}').saveModel('POST', {id: '#{model.id}', mode: 'show'});\n " +- js = "$('#cancel_#{model.id}').cancelEdit({id: '#{model.id}', mode: 'show'});\n " +- js += "$('#save_#{model.id}').saveModel({id: '#{model.id}', mode: 'show'});\n " :javascript $(function() { #{js} |