mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Expose Palettes through PaperScope#palettes.
This commit is contained in:
parent
405198f94d
commit
3fe936addf
2 changed files with 5 additions and 0 deletions
|
@ -52,6 +52,7 @@ var PaperScope = this.PaperScope = Base.extend(/** @lends PaperScope# */{
|
|||
this.project = null;
|
||||
this.projects = [];
|
||||
this.tools = [];
|
||||
this.palettes = [];
|
||||
// Assign an id to this canvas that's either extracted from the script
|
||||
// or automatically generated.
|
||||
this._id = script && (script.getAttribute('id') || script.src)
|
||||
|
@ -170,6 +171,8 @@ var PaperScope = this.PaperScope = Base.extend(/** @lends PaperScope# */{
|
|||
this.projects[i].remove();
|
||||
for (var i = this.tools.length - 1; i >= 0; i--)
|
||||
this.tools[i].remove();
|
||||
for (var i = this.palettes.length - 1; i >= 0; i--)
|
||||
this.palettes[i].remove();
|
||||
},
|
||||
|
||||
remove: function() {
|
||||
|
|
|
@ -58,6 +58,8 @@ var Palette = this.Palette = Base.extend(Callback, /** @lends Palette# */{
|
|||
}
|
||||
});
|
||||
});
|
||||
if (window.paper)
|
||||
paper.palettes.push(this);
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
|
|
Loading…
Reference in a new issue