From 827e8a5ba7232a27af412e190c3b64def94ee7f4 Mon Sep 17 00:00:00 2001 From: Teemu Husso Date: Tue, 4 Jun 2013 10:22:54 +0200 Subject: [PATCH] Wrap id's of selectors in quotes Merges disqus/gargoyle#73. This fixes the cases with newer jQuery where selector contains dot characters. --- HISTORY.rst | 2 ++ gargoyle/media/js/gargoyle.js | 8 ++++---- setup.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a53f8317..6f61db0e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -11,6 +11,8 @@ Pending Release * Fixed the splitting of ``Range`` conditions, a merge of disqus/gargoyle#55, thanks @matclayton. * Fixed the parsing of ``Range`` conditions for the Nexus admin interface. +* Fixed the Nexus interface to work with Switches that contain dots in their + names, a merge of disqus/gargoyle#73, thanks @Raekkeri. 1.1.1 (2016-01-15) ------------------ diff --git a/gargoyle/media/js/gargoyle.js b/gargoyle/media/js/gargoyle.js index 16d3981f..36e01f4c 100644 --- a/gargoyle/media/js/gargoyle.js +++ b/gargoyle/media/js/gargoyle.js @@ -129,7 +129,7 @@ $(document).ready(function () { $(this). parents("tr:first"). - find("div[data-path=" + field[0] + "." + field[1] + "]").show(); + find("div[data-path='" + field[0] + "." + field[1] + "']").show(); }); $("div.conditionsForm form").live("submit", function (ev) { @@ -154,7 +154,7 @@ $(document).ready(function () { api(GARGOYLE.addCondition, data, function (swtch) { var result = $("#switchData").tmpl(swtch); - $("table.switches tr[data-switch-key="+ data.key + "]").replaceWith(result); + $("table.switches tr[data-switch-key='"+ data.key + "']").replaceWith(result); }); }); @@ -172,7 +172,7 @@ $(document).ready(function () { api(GARGOYLE.delCondition, data, function (swtch) { var result = $("#switchData").tmpl(swtch); - $("table.switches tr[data-switch-key="+ data.key + "]").replaceWith(result); + $("table.switches tr[data-switch-key='"+ data.key + "']").replaceWith(result); }); }); @@ -208,7 +208,7 @@ $(document).ready(function () { $.facebox.close(); } else { - $("table.switches tr[data-switch-key=" + curkey + "]").replaceWith(result); + $("table.switches tr[data-switch-key='" + curkey + "']").replaceWith(result); $.facebox.close(); } result.click(); diff --git a/setup.py b/setup.py index 06145330..480481d0 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def get_version(package): zip_safe=False, install_requires=[ 'django-modeldict-yplan>=1.5.0', - 'nexus-yplan>=1.1.0', + 'nexus-yplan>=1.2.0', 'django-jsonfield>=0.9.2,!=0.9.13', ], license='Apache License 2.0',