cleaned up "cancel" button behavior, also closes #608
parent
f33726a778
commit
580f6d990e
|
@ -489,13 +489,18 @@ var ClientFormView = Backbone.View.extend({
|
||||||
$("#refresh-token-timeout-unit", this.$el).prop('disabled',!$("#refresh-token-timeout-unit", this.$el).prop('disabled'));
|
$("#refresh-token-timeout-unit", this.$el).prop('disabled',!$("#refresh-token-timeout-unit", this.$el).prop('disabled'));
|
||||||
document.getElementById("refresh-token-timeout-time").value = '';
|
document.getElementById("refresh-token-timeout-time").value = '';
|
||||||
},
|
},
|
||||||
"click .btn-cancel": function() { window.history.back(); return false; },
|
"click .btn-cancel":"cancel",
|
||||||
"change #requireClientSecret":"toggleRequireClientSecret",
|
"change #requireClientSecret":"toggleRequireClientSecret",
|
||||||
"change #displayClientSecret":"toggleDisplayClientSecret",
|
"change #displayClientSecret":"toggleDisplayClientSecret",
|
||||||
"change #generateClientSecret":"toggleGenerateClientSecret",
|
"change #generateClientSecret":"toggleGenerateClientSecret",
|
||||||
"change #logoUri input":"previewLogo"
|
"change #logoUri input":"previewLogo"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cancel:function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
app.navigate('admin/clients', {trigger: true});
|
||||||
|
},
|
||||||
|
|
||||||
load:function(callback) {
|
load:function(callback) {
|
||||||
if (this.options.systemScopeList.isFetched) {
|
if (this.options.systemScopeList.isFetched) {
|
||||||
$('#loadingbox').sheet('hide');
|
$('#loadingbox').sheet('hide');
|
||||||
|
|
|
@ -185,11 +185,16 @@ var DynRegEditView = Backbone.View.extend({
|
||||||
|
|
||||||
events:{
|
events:{
|
||||||
"click .btn-save":"saveClient",
|
"click .btn-save":"saveClient",
|
||||||
"click .btn-cancel": function() { window.history.back(); return false; },
|
"click .btn-cancel":"cancel",
|
||||||
"click .btn-delete":"deleteClient",
|
"click .btn-delete":"deleteClient",
|
||||||
"change #logoUri input":"previewLogo"
|
"change #logoUri input":"previewLogo"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cancel:function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
app.navigate('dev/dynreg', {trigger: true});
|
||||||
|
},
|
||||||
|
|
||||||
deleteClient:function (e) {
|
deleteClient:function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
|
|
@ -185,11 +185,16 @@ var ResRegEditView = Backbone.View.extend({
|
||||||
|
|
||||||
events:{
|
events:{
|
||||||
"click .btn-save":"saveClient",
|
"click .btn-save":"saveClient",
|
||||||
"click .btn-cancel": function() { window.history.back(); return false; },
|
"click .btn-cancel":"cancel",
|
||||||
"click .btn-delete":"deleteClient",
|
"click .btn-delete":"deleteClient",
|
||||||
"change #logoUri input":"previewLogo"
|
"change #logoUri input":"previewLogo"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
cancel:function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
app.navigate('dev/resource', {trigger: true});
|
||||||
|
},
|
||||||
|
|
||||||
deleteClient:function (e) {
|
deleteClient:function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,14 @@ var WhiteListFormView = Backbone.View.extend({
|
||||||
|
|
||||||
cancelWhiteList:function(e) {
|
cancelWhiteList:function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
app.navigate('admin/whitelists', {trigger:true});
|
// TODO: figure out where we came from and go back there instead
|
||||||
|
if (this.model.get('id') == null) {
|
||||||
|
// if it's a new whitelist entry, go back to the client listing page
|
||||||
|
app.navigate('admin/clients', {trigger:true});
|
||||||
|
} else {
|
||||||
|
// if we're editing a whitelist, go back to the whitelists page
|
||||||
|
app.navigate('admin/whitelists', {trigger:true});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
render:function (eventName) {
|
render:function (eventName) {
|
||||||
|
|
Loading…
Reference in New Issue