Created
May 15, 2015 19:21
-
-
Save handrus/2807609b9d7604b3bd4d to your computer and use it in GitHub Desktop.
CPN_7.x-1.x_patches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cpn.js b/cpn.js | |
index 57a25d8..2029107 100644 | |
--- a/cpn.js | |
+++ b/cpn.js | |
@@ -9,7 +9,13 @@ | |
attach: function(context, settings) { | |
// Append enable/disable links. | |
$('.form-item-cpn-css, .form-item-cpn-js', context).each(function() { | |
- $('.description', this).append(' <a href="#" class="cpn-toggle">Enable syntax highlighting</a>.'); | |
+ if ($('.description', this).length) { | |
+ var el = $('.description', this); | |
+ } | |
+ else { | |
+ var el = $('.help-block', this); | |
+ } | |
+ el.append(' <a href="#" class="cpn-toggle">Enable syntax highlighting</a>.'); | |
}); | |
// Toggle syntax highlighting. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment