Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 370030: Ensure that favorites service is instantiated before tryi…
…ng to get it from the services registry.
  • Loading branch information
Andrew Eisenberg committed Jan 28, 2012
1 parent 6d071e1 commit ae396ea
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -13,8 +13,8 @@
/*jslint browser:true*/
/*global define orion window dojo dijit*/

define(['require', 'dojo', 'dijit', "orion/util", 'dijit/Dialog', 'dijit/form/TextBox',
'orion/widgets/_OrionDialogMixin', 'text!orion/widgets/templates/OpenResourceDialog.html'], function(require, dojo, dijit, mUtil) {
define(['require', 'dojo', 'dijit', "orion/util", 'orion/favorites', 'dijit/Dialog', 'dijit/form/TextBox',
'orion/widgets/_OrionDialogMixin', 'text!orion/widgets/templates/OpenResourceDialog.html'], function(require, dojo, dijit, mUtil, mFavorites) {

/**
* Usage: <code>new widgets.OpenResourceDialog(options).show();</code>
Expand Down Expand Up @@ -51,6 +51,10 @@ var OpenResourceDialog = dojo.declare("orion.widgets.OpenResourceDialog", [dijit
throw new Error("Missing required argument: serviceRegistry");
}
this.favService = serviceRegistry.getService("orion.core.favorite");
if (!this.favService) {
new mFavorites.FavoritesService({serviceRegistry: serviceRegistry});
this.favService = serviceRegistry.getService("orion.core.favorite");
}
},

/** @private */
Expand Down

0 comments on commit ae396ea

Please sign in to comment.