aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 079ae0da4..5a3b25c3f 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -975,11 +975,6 @@ function init_print_action() {
function init_share_observers() {
shares = $('.form-group:not(".form-actions")').length;
- $('.post').on('click', '.share.remove', function(e) {
- e.preventDefault();
- $(this).parents('.form-group').remove();
- });
-
$('.share.add').on('click', function(e) {
var opt = $(this).siblings('select').find(':selected');
var row = $(this).parents('form').data(opt.data('form'));
@@ -994,10 +989,16 @@ function init_share_observers() {
});
}
-function init_queries_observers() {
- $('.post').on('click', '.query.remove', function(e) {
- e.preventDefault();
- $(this).parents('.form-group').remove();
+function init_remove_observers() {
+ $('.post').on('click', 'a.remove', function(e) {
+ var remove_what = $(this).attr('data-remove');
+
+ if (remove_what !== undefined) {
+ var remove_obj = $('#' + remove_what);
+ remove_obj.remove();
+ }
+
+ return false;
});
}
@@ -1061,7 +1062,7 @@ function init_all() {
window.setInterval(refreshUnreads, 120000);
} else {
init_share_observers();
- init_queries_observers();
+ init_remove_observers();
init_feed_observers();
init_password_observers();
}