Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ReentryHelpers to help stop Window:closed event being thrown mu…
…ltiple times
- Loading branch information
1 parent
1cf52ee
commit e09ac1e
Showing
5 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module Redcar | ||
module Model | ||
include Redcar::ReentryHelpers | ||
|
||
attr_reader :controller | ||
|
||
def controller=(controller) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Redcar | ||
module ReentryHelpers | ||
def ignore_changes | ||
@ignore_changes ||= Hash.new(0) | ||
end | ||
|
||
def ignore(name) | ||
ignore_changes[name] += 1 | ||
yield if ignore_changes[name] == 1 | ||
ignore_changes[name] -= 1 | ||
end | ||
end | ||
end |