From 6c29ff80d272f2dd68a4b61af5082354403d944a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C3=A9fir=20Destiny?= Date: Wed, 21 Aug 2013 13:26:38 +0200 Subject: [PATCH] Fix some JS glitch with external use --- bbcode.php | 2 ++ js/script.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bbcode.php b/bbcode.php index e90a0ae..5d074b8 100644 --- a/bbcode.php +++ b/bbcode.php @@ -71,6 +71,8 @@ if (!class_exists('cartpaujBBCodeParser')) function bbc2html($subject) { + wp_enqueue_script('mingle-forum', plugins_url('js/script.js', __FILE__), array('jquery')); + $codes = array(array(), array()); preg_match_all('/\[code\](.+)\[\/code\]/Uis', $subject, $codes); diff --git a/js/script.js b/js/script.js index 105e8ec..7ae67d6 100644 --- a/js/script.js +++ b/js/script.js @@ -116,8 +116,8 @@ function uncheckglobal(headerfield, checkform){ checkform.mod_global.checked = false; } -jQuery().ready(function () { - jQuery('.mingle-spoiler-view li:first-child').click(function () { +jQuery(function() { + jQuery('.mingle-spoiler-view li:first-child').live('click', function() { var text = jQuery(this).parent().find('li:last-child'); if (text.is(':hidden')) { text.slideDown('200');