Skip to content

Instantly share code, notes, and snippets.

@handrus
Created May 15, 2015 19:21
Show Gist options
  • Save handrus/2807609b9d7604b3bd4d to your computer and use it in GitHub Desktop.
Save handrus/2807609b9d7604b3bd4d to your computer and use it in GitHub Desktop.
CPN_7.x-1.x_patches
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