aboutsummaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2017-10-26 02:49:16 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-10-26 08:49:16 +0800
commit3ab580c8d6b8a2c063d848f8e3002347c9e5cebb (patch)
tree3f66f793be25db1ca8baac8d5333e39bfdd4f7e1 /public/js
parente86a0bf3feab82c1b3439806245083dffb2f37c9 (diff)
downloadgitea-3ab580c8d6b8a2c063d848f8e3002347c9e5cebb.tar.gz
gitea-3ab580c8d6b8a2c063d848f8e3002347c9e5cebb.zip
Add branch overiew page (#2108)
* Add branch overiew page * fix changed method name on sub menu * remove unused code
Diffstat (limited to 'public/js')
-rw-r--r--public/js/index.js59
1 files changed, 37 insertions, 22 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 258db95540..259980c3ca 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1423,29 +1423,18 @@ $(document).ready(function () {
});
// Helpers.
- $('.delete-button').click(function () {
- var $this = $(this);
- var filter = "";
- if ($this.attr("id")) {
- filter += "#"+$this.attr("id")
- }
- $('.delete.modal'+filter).modal({
- closable: false,
- onApprove: function () {
- if ($this.data('type') == "form") {
- $($this.data('form')).submit();
- return;
- }
+ $('.delete-button').click(showDeletePopup);
- $.post($this.data('url'), {
- "_csrf": csrf,
- "id": $this.data("id")
- }).done(function (data) {
- window.location.href = data.redirect;
- });
- }
- }).modal('show');
- return false;
+ $('.delete-branch-button').click(showDeletePopup);
+
+ $('.undo-button').click(function() {
+ var $this = $(this);
+ $.post($this.data('url'), {
+ "_csrf": csrf,
+ "id": $this.data("id")
+ }).done(function(data) {
+ window.location.href = data.redirect;
+ });
});
$('.show-panel.button').click(function () {
$($(this).data('panel')).show();
@@ -1608,6 +1597,32 @@ $(function () {
});
});
+function showDeletePopup() {
+ var $this = $(this);
+ var filter = "";
+ if ($this.attr("id")) {
+ filter += "#" + $this.attr("id")
+ }
+
+ $('.delete.modal' + filter).modal({
+ closable: false,
+ onApprove: function() {
+ if ($this.data('type') == "form") {
+ $($this.data('form')).submit();
+ return;
+ }
+
+ $.post($this.data('url'), {
+ "_csrf": csrf,
+ "id": $this.data("id")
+ }).done(function(data) {
+ window.location.href = data.redirect;
+ });
+ }
+ }).modal('show');
+ return false;
+}
+
function initVueComponents(){
var vueDelimeters = ['${', '}'];