diff --git a/LICENSE b/LICENSE index bda0ddf5a..bb7ae873f 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.4.1 - 2014-03-08 +* 4chan X - Version 1.4.1 - 2014-03-09 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index dd02d7251..88fef8ba9 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.4.1 - 2014-03-08 +* 4chan X - Version 1.4.1 - 2014-03-09 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -3857,7 +3857,9 @@ return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', node)); }, contextFromNode: function(node) { - return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', node)); + var snapshot; + snapshot = $.X('ancestor::div[contains(@class,"postContainer")]', node); + return Get.postFromRoot(snapshot.snapshotItem(snapshot.length - 1)); }, postDataFromLink: function(link) { var boardID, path, postID, threadID, _ref; diff --git a/builds/crx/script.js b/builds/crx/script.js index 30e9c9b88..e72c841c5 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.4.1 - 2014-03-08 +* 4chan X - Version 1.4.1 - 2014-03-09 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -3916,7 +3916,9 @@ return Get.postFromRoot($.x('ancestor::div[contains(@class,"postContainer")][1]', node)); }, contextFromNode: function(node) { - return Get.postFromRoot($.x('ancestor::div[parent::div[@class="thread"]][1]', node)); + var snapshot; + snapshot = $.X('ancestor::div[contains(@class,"postContainer")]', node); + return Get.postFromRoot(snapshot.snapshotItem(snapshot.length - 1)); }, postDataFromLink: function(link) { var boardID, path, postID, threadID, _ref; diff --git a/src/General/Get.coffee b/src/General/Get.coffee index d8176a7ee..11ea71b6b 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -17,7 +17,8 @@ Get = postFromNode: (node) -> Get.postFromRoot $.x 'ancestor::div[contains(@class,"postContainer")][1]', node contextFromNode: (node) -> - Get.postFromRoot $.x 'ancestor::div[parent::div[@class="thread"]][1]', node + snapshot = $.X 'ancestor::div[contains(@class,"postContainer")]', node + Get.postFromRoot snapshot.snapshotItem(snapshot.length - 1) postDataFromLink: (link) -> if link.hostname is 'boards.4chan.org' path = link.pathname.split '/'