allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [01/16] allura git commit: [#8230] revert change to checklist.js and create separate Checklist objects
Date Mon, 15 Oct 2018 16:02:25 GMT
Repository: allura
Updated Branches:
  refs/heads/master 181b82e6b -> fc4472710


[#8230] revert change to checklist.js and create separate Checklist objects


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/fc447271
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fc447271
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fc447271

Branch: refs/heads/master
Commit: fc44727107b035658efd5290ed53f0c96d1c8eeb
Parents: c07970e
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Mon Oct 15 15:40:20 2018 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Oct 15 15:50:29 2018 +0000

----------------------------------------------------------------------
 Allura/allura/public/nf/js/allura-base.js | 29 ++++++++++++++------------
 Allura/allura/public/nf/js/checklist.js   |  2 +-
 2 files changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/fc447271/Allura/allura/public/nf/js/allura-base.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/allura-base.js b/Allura/allura/public/nf/js/allura-base.js
index ed62d8f..945d97e 100644
--- a/Allura/allura/public/nf/js/allura-base.js
+++ b/Allura/allura/public/nf/js/allura-base.js
@@ -235,19 +235,22 @@ $(function(){
 
 // Interactive checkboxes
 $(function(){
-    new Checklists(".active-md", function(checkbox, callback) {
-        var uri = $(checkbox).closest('.active-md').data('markdownlink');
-        $.get(uri + 'get_markdown', callback);
-    }, function(markdown, checkbox, callback) {
-        var uri = $(checkbox).closest('.active-md').data('markdownlink');
-        $.ajax({
-            type: 'post',
-            url: uri + 'update_markdown',
-            data: {
-                'text' : markdown,
-                '_session_id' : $.cookie('_session_id')
-            },
-            success: callback
+    $('.active-md').each(function() {
+        var $active_md = $(this);
+        new Checklists($active_md, function(checkbox, callback) {
+            var uri = $active_md.data('markdownlink');
+            $.get(uri + 'get_markdown', callback);
+        }, function(markdown, checkbox, callback) {
+            var uri = $active_md.data('markdownlink');
+            $.ajax({
+                type: 'post',
+                url: uri + 'update_markdown',
+                data: {
+                    'text' : markdown,
+                    '_session_id' : $.cookie('_session_id')
+                },
+                success: callback
+            });
         });
     });
 });

http://git-wip-us.apache.org/repos/asf/allura/blob/fc447271/Allura/allura/public/nf/js/checklist.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/checklist.js b/Allura/allura/public/nf/js/checklist.js
index 32642f7..c1edac2 100644
--- a/Allura/allura/public/nf/js/checklist.js
+++ b/Allura/allura/public/nf/js/checklist.js
@@ -32,7 +32,7 @@ var Checklists = (function($) {
     Checklists.prototype.checkboxSelector = "> li > input:checkbox";
     Checklists.prototype.onChange = function(ev, self) {
         var checkbox = $(this).prop("disabled", true);
-        var index = $("ul" + self.checkboxSelector, $(this).closest('.active-md')).index(this);
+        var index = $("ul" + self.checkboxSelector, self.container).index(this);
         var reactivate = function() { checkbox.prop("disabled", false); };
         self.retriever(checkbox, function(markdown) {
             markdown = self.toggleCheckbox(index, markdown);


Mime
View raw message