From 0620d19f269369cdeea40446718383ee245e6aa5 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 11 Apr 2013 17:04:49 -0600 Subject: [PATCH] Require jquery-ui-sortable and -draggable in the general config panel. This commit has a hack to make window.jQuery available during the duration of the requiring of jquery-ui. Once we're done requiring jQuery, the global is removed from window once again. Issue #494 has an alternative idea of enhancing require to allow the requiring script to specify the value of global variables in the script being required. --- package.json | 3 ++- src/app/general-config-panel.coffee | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 140bafa63..7cb8f62fe 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "pathwatcher": "0.3.0", "plist": "git://github.com/nathansobo/node-plist.git", "space-pen": "git://github.com/nathansobo/space-pen.git", - "less": "git://github.com/nathansobo/less.js.git" + "less": "git://github.com/nathansobo/less.js.git", + "jqueryui-browser": "1.10.2" }, "devDependencies" : { diff --git a/src/app/general-config-panel.coffee b/src/app/general-config-panel.coffee index 737b1b51a..73ca94bdc 100644 --- a/src/app/general-config-panel.coffee +++ b/src/app/general-config-panel.coffee @@ -3,6 +3,14 @@ ConfigPanel = require 'config-panel' $ = require 'jquery' _ = require 'underscore' +window.jQuery = $ +require 'jqueryui-browser/ui/jquery.ui.core' +require 'jqueryui-browser/ui/jquery.ui.widget' +require 'jqueryui-browser/ui/jquery.ui.mouse' +require 'jqueryui-browser/ui/jquery.ui.sortable' +require 'jqueryui-browser/ui/jquery.ui.draggable' +delete window.jQuery + module.exports = class GeneralConfigPanel extends ConfigPanel @content: ->