Node.js based forum software built for the modern web
components system
psychobunny54cbbe2844d5
diff --git a/public/src/client/topic/events.js b/public/src/client/topic/events.jsindex c90dd149b5..25b872e649 100644--- a/public/src/client/topic/events.js+++ b/public/src/client/topic/events.js@@ -96,7 +96,7 @@ define('forum/topic/events', [}function onPostEdited(data) {- var editedPostEl = $('#content_' + data.pid),+ var editedPostEl = components.get('post/content', data.pid),editedPostTitle = $('#topic_title_' + data.pid);if (editedPostTitle.length) {diff --git a/public/src/components.js b/public/src/components.jsnew file mode 100644index 0000000000..2bd94b06f0--- /dev/null+++ b/public/src/components.js@@ -0,0 +1,17 @@+"use strict";++var components = components || {};++(function() {+ components.core = {+ 'post/content': function(pid) {+ var el = $('[data-pid="' + pid + '"]').find('[component="post/content"]');+ return el.length ? el : $('[data-pid="' + pid + '"]').find('.post-content'); // deprecated after 0.7x+ }+ };++ components.get = function() {+ var args = Array.prototype.slice.call(arguments, 1);+ return components.core[arguments[0]].apply(this, args);+ };+}());\ No newline at end of filediff --git a/src/meta/js.js b/src/meta/js.jsindex 4373d21a1d..3d8ced839c 100644--- a/src/meta/js.js+++ b/src/meta/js.js@@ -44,10 +44,11 @@ module.exports = function(Meta) {'public/src/utils.js','public/src/app.js','public/src/ajaxify.js',- 'public/src/variables.js',- 'public/src/widgets.js',+ 'public/src/components.js',+ 'public/src/overrides.js','public/src/translator.js',- 'public/src/overrides.js'+ 'public/src/variables.js',+ 'public/src/widgets.js'],rjs: []}