Commit 336f3f39 by David Taylor Committed by GitHub

Merge pull request #30 from spadgett/remove-back-directive

Only use window history back when no cancel callback
parents fd5caed1 4ab390f2
...@@ -87,7 +87,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -87,7 +87,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <button\n" + " <button\n" +
" class=\"btn btn-default btn-lg\"\n" + " class=\"btn btn-default btn-lg\"\n" +
" ng-class=\"{'dialog-btn': isDialog}\"\n" + " ng-class=\"{'dialog-btn': isDialog}\"\n" +
" back\n" +
" ng-click=\"cancelCreateProject()\">\n" + " ng-click=\"cancelCreateProject()\">\n" +
" Cancel\n" + " Cancel\n" +
" </button>\n" + " </button>\n" +
...@@ -191,7 +190,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -191,7 +190,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <button\n" + " <button\n" +
" class=\"btn btn-default btn-lg\"\n" + " class=\"btn btn-default btn-lg\"\n" +
" ng-class=\"{'dialog-btn': isDialog}\"\n" + " ng-class=\"{'dialog-btn': isDialog}\"\n" +
" back\n" +
" ng-click=\"cancelEditProject()\">\n" + " ng-click=\"cancelEditProject()\">\n" +
" Cancel\n" + " Cancel\n" +
" </button>\n" + " </button>\n" +
...@@ -233,7 +231,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -233,7 +231,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
angular.module("openshiftCommonUI") angular.module("openshiftCommonUI")
.directive("createProject", function() { .directive("createProject", function($window) {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
...@@ -291,6 +289,8 @@ angular.module("openshiftCommonUI") ...@@ -291,6 +289,8 @@ angular.module("openshiftCommonUI")
if (cb) { if (cb) {
cb(); cb();
} }
} else {
$window.history.back();
} }
}; };
}, },
...@@ -434,7 +434,7 @@ angular.module('openshiftCommonUI') ...@@ -434,7 +434,7 @@ angular.module('openshiftCommonUI')
angular.module("openshiftCommonUI") angular.module("openshiftCommonUI")
.directive("editProject", function() { .directive("editProject", function($window) {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
...@@ -517,6 +517,8 @@ angular.module("openshiftCommonUI") ...@@ -517,6 +517,8 @@ angular.module("openshiftCommonUI")
var cb = $scope.onCancel(); var cb = $scope.onCancel();
if (cb) { if (cb) {
cb(); cb();
} else {
$window.history.back();
} }
}; };
}, },
......
...@@ -257,7 +257,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -257,7 +257,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <button\n" + " <button\n" +
" class=\"btn btn-default btn-lg\"\n" + " class=\"btn btn-default btn-lg\"\n" +
" ng-class=\"{'dialog-btn': isDialog}\"\n" + " ng-class=\"{'dialog-btn': isDialog}\"\n" +
" back\n" +
" ng-click=\"cancelCreateProject()\">\n" + " ng-click=\"cancelCreateProject()\">\n" +
" Cancel\n" + " Cancel\n" +
" </button>\n" + " </button>\n" +
...@@ -361,7 +360,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -361,7 +360,6 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
" <button\n" + " <button\n" +
" class=\"btn btn-default btn-lg\"\n" + " class=\"btn btn-default btn-lg\"\n" +
" ng-class=\"{'dialog-btn': isDialog}\"\n" + " ng-class=\"{'dialog-btn': isDialog}\"\n" +
" back\n" +
" ng-click=\"cancelEditProject()\">\n" + " ng-click=\"cancelEditProject()\">\n" +
" Cancel\n" + " Cancel\n" +
" </button>\n" + " </button>\n" +
...@@ -403,7 +401,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI'); ...@@ -403,7 +401,7 @@ hawtioPluginLoader.addModule('openshiftCommonUI');
angular.module("openshiftCommonUI") angular.module("openshiftCommonUI")
.directive("createProject", function() { .directive("createProject", ["$window", function($window) {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
...@@ -461,11 +459,13 @@ angular.module("openshiftCommonUI") ...@@ -461,11 +459,13 @@ angular.module("openshiftCommonUI")
if (cb) { if (cb) {
cb(); cb();
} }
} else {
$window.history.back();
} }
}; };
}], }],
}; };
}); }]);
;'use strict'; ;'use strict';
angular.module("openshiftCommonUI") angular.module("openshiftCommonUI")
...@@ -604,7 +604,7 @@ angular.module('openshiftCommonUI') ...@@ -604,7 +604,7 @@ angular.module('openshiftCommonUI')
angular.module("openshiftCommonUI") angular.module("openshiftCommonUI")
.directive("editProject", function() { .directive("editProject", ["$window", function($window) {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
...@@ -687,11 +687,13 @@ angular.module("openshiftCommonUI") ...@@ -687,11 +687,13 @@ angular.module("openshiftCommonUI")
var cb = $scope.onCancel(); var cb = $scope.onCancel();
if (cb) { if (cb) {
cb(); cb();
} else {
$window.history.back();
} }
}; };
}], }],
}; };
}); }]);
;'use strict'; ;'use strict';
angular.module('openshiftCommonUI') angular.module('openshiftCommonUI')
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -77,7 +77,6 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -77,7 +77,6 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
" <button\n" + " <button\n" +
" class=\"btn btn-default btn-lg\"\n" + " class=\"btn btn-default btn-lg\"\n" +
" ng-class=\"{'dialog-btn': isDialog}\"\n" + " ng-class=\"{'dialog-btn': isDialog}\"\n" +
" back\n" +
" ng-click=\"cancelCreateProject()\">\n" + " ng-click=\"cancelCreateProject()\">\n" +
" Cancel\n" + " Cancel\n" +
" </button>\n" + " </button>\n" +
...@@ -181,7 +180,6 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac ...@@ -181,7 +180,6 @@ angular.module('openshiftCommonUI').run(['$templateCache', function($templateCac
" <button\n" + " <button\n" +
" class=\"btn btn-default btn-lg\"\n" + " class=\"btn btn-default btn-lg\"\n" +
" ng-class=\"{'dialog-btn': isDialog}\"\n" + " ng-class=\"{'dialog-btn': isDialog}\"\n" +
" back\n" +
" ng-click=\"cancelEditProject()\">\n" + " ng-click=\"cancelEditProject()\">\n" +
" Cancel\n" + " Cancel\n" +
" </button>\n" + " </button>\n" +
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
<button <button
class="btn btn-default btn-lg" class="btn btn-default btn-lg"
ng-class="{'dialog-btn': isDialog}" ng-class="{'dialog-btn': isDialog}"
back
ng-click="cancelCreateProject()"> ng-click="cancelCreateProject()">
Cancel Cancel
</button> </button>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
angular.module("openshiftCommonUI") angular.module("openshiftCommonUI")
.directive("createProject", function() { .directive("createProject", function($window) {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
...@@ -60,6 +60,8 @@ angular.module("openshiftCommonUI") ...@@ -60,6 +60,8 @@ angular.module("openshiftCommonUI")
if (cb) { if (cb) {
cb(); cb();
} }
} else {
$window.history.back();
} }
}; };
}, },
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<button <button
class="btn btn-default btn-lg" class="btn btn-default btn-lg"
ng-class="{'dialog-btn': isDialog}" ng-class="{'dialog-btn': isDialog}"
back
ng-click="cancelEditProject()"> ng-click="cancelEditProject()">
Cancel Cancel
</button> </button>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
angular.module("openshiftCommonUI") angular.module("openshiftCommonUI")
.directive("editProject", function() { .directive("editProject", function($window) {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
...@@ -85,6 +85,8 @@ angular.module("openshiftCommonUI") ...@@ -85,6 +85,8 @@ angular.module("openshiftCommonUI")
var cb = $scope.onCancel(); var cb = $scope.onCancel();
if (cb) { if (cb) {
cb(); cb();
} else {
$window.history.back();
} }
}; };
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment