Added more magic to fancy. it now automatically figures our response for PUT and POST based on request ID.

file name sample uses HTTP GET instead of post
This commit is contained in:
kay.one
2013-08-25 22:14:55 -07:00
parent 438e3199de
commit 4188946395
20 changed files with 135 additions and 198 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
'use strict';
'use strict';
define(
[
'Settings/SettingsModelBase'
+9 -11
View File
@@ -19,13 +19,13 @@ define(
'change .x-rename-episodes': '_setNamingOptionsVisibility'
},
onRender: function(){
if(!this.model.get('renameEpisodes')){
onRender: function () {
if (!this.model.get('renameEpisodes')) {
this.ui.namingOptions.hide();
}
this.listenTo(this.model, 'change', this._buildExamples);
this._buildExamples();
this.listenTo(this.model, 'change', this._updateExamples);
this._updateExamples();
},
_setNamingOptionsVisibility: function () {
@@ -39,16 +39,14 @@ define(
}
},
_buildExamples: function () {
_updateExamples: function () {
var self = this;
var data = this.model.toJSON();
data.id = 0;
var promise = $.ajax({
type: 'POST',
url : window.ApiRoot + '/naming',
data: JSON.stringify(data)
type: 'GET',
url : window.ApiRoot + '/config/naming/samples',
data: this.model.toJSON()
});
promise.done(function (result) {