From 2101d4f3d1b215692e1cdb336c2203254b464188 Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Tue, 25 Sep 2012 09:33:45 +0100 Subject: [PATCH] Use provided selector for all jQuery selections --- ckan/public/base/datapreview/recline.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ckan/public/base/datapreview/recline.js b/ckan/public/base/datapreview/recline.js index c4d7136f115..f6bd6ab115d 100644 --- a/ckan/public/base/datapreview/recline.js +++ b/ckan/public/base/datapreview/recline.js @@ -27,7 +27,7 @@ ckan.module('reclinepreview', function (jQuery, _) { function showError(msg){ msg = msg || _('error loading preview'); - return jQuery('#ckanext-datapreview') + return self.el .append('
') .addClass('alert alert-error fade in') .html(msg); @@ -127,7 +127,7 @@ ckan.module('reclinepreview', function (jQuery, _) { // Hide the fields control by default // (This should be done in recline!) - jQuery('.menu-right a[data-action="fields"]').click(); + jQuery('.menu-right a[data-action="fields"]', self.el).click(); }, showError: function (error) { var _html = _.template( @@ -170,8 +170,8 @@ ckan.module('reclinepreview', function (jQuery, _) { // iframeWidth and iframeHeight control the width and height parameters // used to construct the iframe, and are also used in the link. - var iframeWidth = jQuery('.iframe-width'); - var iframeHeight = jQuery('.iframe-height'); + var iframeWidth = jQuery('.iframe-width', self.el); + var iframeHeight = jQuery('.iframe-height', self.el); var width = iframeWidth.val(); var height = iframeHeight.val();