Skip to content
Browse files

Don't use `$.Deferred` directly

  • Loading branch information...
1 parent ce167fe commit f6ae64f5a96813e273be6701560139f906368e3d @mikaelkaron mikaelkaron committed Apr 16, 2012
Showing with 6 additions and 6 deletions.
  1. +3 −3 src/component/widget.js
  2. +3 −3 src/widget/placeholder.js
View
6 src/component/widget.js
@@ -6,7 +6,7 @@
/**
* The widget trait provides common UI related logic
*/
-define([ "compose", "./gadget", "jquery" ], function WidgetModule(Compose, Gadget, $) {
+define([ "compose", "./gadget", "jquery", "deferred" ], function WidgetModule(Compose, Gadget, $, Deferred) {
var NULL = null;
var FUNCTION = Function;
var ARRAY_PROTO = Array.prototype;
@@ -69,7 +69,7 @@ define([ "compose", "./gadget", "jquery" ], function WidgetModule(Compose, Gadge
var $element = self[$ELEMENT];
// Defer render (as weaving it may need to load async)
- var deferredRender = $.Deferred(function deferredRender(dfdRender) {
+ var deferredRender = Deferred(function deferredRender(dfdRender) {
// Call render
op.call($element, contents);
@@ -228,7 +228,7 @@ define([ "compose", "./gadget", "jquery" ], function WidgetModule(Compose, Gadge
var $element = self[$ELEMENT];
// Create deferred for emptying
- var emptyDeferred = $.Deferred(function emptyDeferred(dfd) {
+ var emptyDeferred = Deferred(function emptyDeferred(dfd) {
// Detach contents
var $contents = $element.contents().detach();
View
6 src/widget/placeholder.js
@@ -3,7 +3,7 @@
* @license TroopJS 0.0.1 Copyright 2012, Mikael Karon <mikael@karon.se>
* Released under the MIT license.
*/
-define([ "compose", "../component/widget", "jquery" ], function WidgetPlaceholderModule(Compose, Widget, $) {
+define([ "compose", "../component/widget", "jquery", "deferred" ], function WidgetPlaceholderModule(Compose, Widget, $, Deferred) {
var NULL = null;
var UNDEFINED = undefined;
var ARRAY = Array;
@@ -16,7 +16,7 @@ define([ "compose", "../component/widget", "jquery" ], function WidgetPlaceholde
function release(/* arg, arg, arg, */ deferred) {
// Internal deferred
- $.Deferred(function deferredRelease(dfd) {
+ Deferred(function deferredRelease(dfd) {
// Make arguments into a real array
var argv = ARRAY.apply(ARRAY_PROTO, arguments);
@@ -82,7 +82,7 @@ define([ "compose", "../component/widget", "jquery" ], function WidgetPlaceholde
function hold(deferred) {
// Internal deferred
- $.Deferred(function deferredHold(dfd) {
+ Deferred(function deferredHold(dfd) {
// First check that we're holding
if (_widget === UNDEFINED || _widget === NULL) {
dfd.reject(_widget);

0 comments on commit f6ae64f

Please sign in to comment.
Something went wrong with that request. Please try again.