diff options
author | Einar Egilsson <einar@einaregilsson.com> | 2018-08-17 10:41:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 10:41:40 +0000 |
commit | 005cdf5953a165c5f117102382cd38ecb641fa2f (patch) | |
tree | 274606a100a0f3ccc421229b600ea852b3675426 /js | |
parent | 1e3b1a4867a21b599e8e45296b788977ff7da31a (diff) | |
parent | 4010f12cb2b4508118fa3b8bdb81cf9f23ee598b (diff) |
Merge pull request #123 from umanghome/master
Allows duplication of a redirect rule.
Diffstat (limited to 'js')
-rw-r--r-- | js/controllers/editredirect.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/controllers/editredirect.js b/js/controllers/editredirect.js index 811c92d..3d63340 100644 --- a/js/controllers/editredirect.js +++ b/js/controllers/editredirect.js @@ -23,6 +23,19 @@ redirectorApp.controller('EditRedirectCtrl', ['$scope', function($s) { $s.$parent.showEditForm = true; }; + /** + * Duplicates a redirect. + * @param {Number} index + */ + $s.$parent.duplicateRedirect = function (index) { + var redirect = new Redirect($s.redirects[index]); + + $s.redirects.splice(index + 1, 0, redirect); + + redirect.updateExampleResult(); + $s.saveChanges(); + } + $s.saveRedirect = function() { if ($s.redirect.error) { return; //Button is already disabled, but we still get the click |