Skip to content

Commit

Permalink
Spinner should only dispatch modal if global.
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph committed May 3, 2013
1 parent 7fdb209 commit c316bd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controls/spinner.js
Expand Up @@ -43,7 +43,6 @@ Monocle.Controls.Spinner = function (reader) {
label = label || k.GENERIC_LABEL;
p.repeaters[label] = true;
p.reader.showControl(API);
p.reader.dispatchEvent('monocle:modal:on');

// If the delay is on a page other than the page we've been assigned to,
// don't show the animation. p.global ensures that if an event affects
Expand All @@ -54,6 +53,7 @@ Monocle.Controls.Spinner = function (reader) {
p.showForPages[page.m.pageIndex] = true;
} else {
p.global = true;
p.reader.dispatchEvent('monocle:modal:on');
}
for (var i = 0; i < p.divs.length; ++i) {
var show = (p.global || p.showForPages[i]) ? true : false;
Expand All @@ -75,13 +75,13 @@ Monocle.Controls.Spinner = function (reader) {


function forceSpun() {
if (p.global) { p.reader.dispatchEvent('monocle:modal:off'); }
p.global = false;
p.repeaters = {};
p.showForPages = [];
for (var i = 0; i < p.divs.length; ++i) {
p.divs[i].dom.addClass('dormant');
}
p.reader.dispatchEvent('monocle:modal:off');
}


Expand Down

0 comments on commit c316bd8

Please sign in to comment.