diff options
author | brantje <brantje@gmail.com> | 2017-02-20 19:41:39 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2017-02-22 20:02:55 +0300 |
commit | 925897b8eeeabb1f09307e50e4bb10eae57f65e6 (patch) | |
tree | dc553096d3d1c2c9e56cea3c082521451ab90a53 /js/app/directives | |
parent | fd8dcc6c1ca9e2a5effdff71ee37999d61a58b41 (diff) |
Implement onclick disable directive
Diffstat (limited to 'js/app/directives')
-rw-r--r-- | js/app/directives/clickdisable.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/js/app/directives/clickdisable.js b/js/app/directives/clickdisable.js new file mode 100644 index 00000000..a9f25645 --- /dev/null +++ b/js/app/directives/clickdisable.js @@ -0,0 +1,41 @@ +/** + * Nextcloud - passman + * + * @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com) + * @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es) + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +(function () { + 'use strict'; + + /** + * @ngdoc directive + * @name passmanApp.directive:passwordGen + * @description + * # passwordGen + */ + angular.module('passmanApp') + .directive('clickDisable', function () { + return function (scope, element, attrs) { + element.bind("click", function (event) { + element.prepend('<i class="fa fa-spin fa-spinner"></i> '); + element.attr('disabled','disabled'); + }); + }; + }); +}());
\ No newline at end of file |