Skip to content

Commit

Permalink
chore(palette): use existing parent getter when initializing
Browse files Browse the repository at this point in the history
The current palette implementation is flawed in a way that the parent
it mounts to cannot easily be overridden.

There exists the method Palette#_getParentContainer that serves the
purpose, however it is not being used in the palettes initialization
function.

This commit fixes this behavior.
  • Loading branch information
nikku authored and merge-me[bot] committed Aug 19, 2019
1 parent cf2aee5 commit f765c81
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/features/palette/Palette.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@ Palette.prototype.getEntries = function() {
return entries;
};


/**
* Initialize
*/
Palette.prototype._init = function() {
var canvas = this._canvas,
eventBus = this._eventBus;
var self = this;

var eventBus = this._eventBus;

var parentContainer = this._getParentContainer();

var parent = canvas.getContainer(),
container = this._container = domify(Palette.HTML_MARKUP),
self = this;
var container = this._container = domify(Palette.HTML_MARKUP);

parent.appendChild(container);
parentContainer.appendChild(container);

domDelegate.bind(container, ELEMENT_SELECTOR, 'click', function(event) {

Expand Down

0 comments on commit f765c81

Please sign in to comment.