Permalink
Browse files

Merge pull request #90 from mozilla/fix-app-selection-bug

added handling for serveral app related unhandled states, removed onchan...
  • Loading branch information...
2 parents 5c423f1 + 35568af commit b657dacba0afb1311104c47b53e7210f929a8fad @jeads jeads committed Mar 25, 2013
@@ -102,6 +102,15 @@ var AppsPage = new Class( {
lookup['app_list'] = appList;
var app = $(view.appNameSpanSel).text();
+ //If there's only one app in the applist or the app
+ //is not in the app_list make sure the selected app
+ //is set to the first app in app_list
+ if((appList.length === 1) ||
+ (_.lastIndexOf(appList, app) === -1) ){
+
+ app = appList[0];
+ }
+
if( (app != "") && (appList.length > 0)){
params.push('app=' + app);
lookup['app'] = app;
@@ -344,16 +344,6 @@ var GraphControlsView = new Class({
//added to history
APPS_PAGE.disableSaveState = true;
- //Use the change event to synchronize saving state to after
- //the last checkbox is selected
- $(inputEls[ inputEls.length-1 ]).unbind('change');
- $(inputEls[ inputEls.length-1 ]).bind('change', function(event){
- //Reenable saveState
- APPS_PAGE.disableSaveState = false;
- //Save the new application selection state
- APPS_PAGE.saveState(true);
- });
-
for(var i=0; i<inputEls.length; i++){
var el = inputEls[i];
@@ -373,6 +363,11 @@ var GraphControlsView = new Class({
}
}
+ APPS_PAGE.disableSaveState = false;
+
+ //Save the new application selection state
+ APPS_PAGE.saveState(true);
+
},
selectApplications: function(testIds){

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit b657dac

Please sign in to comment.