forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from mjanez/ckan-2.9.11
Add slug-preview patch
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/ckan/public/base/javascript/plugins/jquery.slug-preview.js b/ckan/public/base/javascript/plugins/jquery.slug-preview.js | ||
index 4a4f78fe25..8c03e816d2 100644 | ||
--- a/ckan/public/base/javascript/plugins/jquery.slug-preview.js | ||
+++ b/ckan/public/base/javascript/plugins/jquery.slug-preview.js | ||
@@ -33,6 +33,11 @@ | ||
var value = preview.find('.slug-preview-value'); | ||
var required = $('<div>').append($('.control-required', element).clone()).html(); | ||
|
||
+ // Check if slugPreview already exists in the parent container | ||
+ if (element.parent().find('.slug-preview').length > 0) { | ||
+ return; | ||
+ } | ||
+ | ||
function setValue() { | ||
var val = escape(field.val()) || options.placeholder; | ||
value.text(val); |