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.
This commit is contained in:
Nathan Sobo
2013-04-11 17:04:49 -06:00
committed by Corey Johnson & Kevin Sawicki
parent 46acb6da2c
commit 0620d19f26
2 changed files with 10 additions and 1 deletions

View File

@@ -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: ->