Set window.app as default value for button group option "app".

This commit is contained in:
2019-08-05 11:44:59 +02:00
parent a44fd6c469
commit 03f927d1d5
69 changed files with 106 additions and 106 deletions
+8 -10
View File
@@ -8229,7 +8229,7 @@
}
static _calculateCenterRelativeTo(target, image) {
console.log("_calculateCenterRelativeTo", target, image);
console.log('_calculateCenterRelativeTo', target, image);
let bbox = image.getBBox();
let width = bbox.width;
let height = bbox.height;
@@ -8238,10 +8238,9 @@
let r = target.getAttribute('r');
let radius = r.endsWith('%') ? (parseFloat(r) / 100) * width : parseFloat(r);
let x = cx.endsWith('%') ? (parseFloat(cx) / 100) * width : cx;
let y = cy.endsWith('%') ? (parseFloat(cy) / 100) * height : cx;
console.log({x, y, width, height , radius});
console.log({ x, y, width, height, radius });
return { x, y }
}
@@ -8253,7 +8252,7 @@
* @returns {bool} false - Returns false to prevent default click action
* @memberof Card
*/
static loadHighlightPopup(event, node=null) {
static loadHighlightPopup(event, node = null) {
if (this.debug) console.log('Card.loadHighlightPopup', event, node);
if (node == null) {
if (event.firstTarget) {
@@ -8262,7 +8261,7 @@
node = event.target;
}
}
let context = this.getContext(node);
event.stopPropagation();
@@ -8282,18 +8281,17 @@
onExpanded: () => {
// We assume it's always a circle. This may break, when other svg shapes are used.
let svgRoot = node.closest('svg');
let image = svgRoot.querySelector('image');
let position = Card._calculateCenterRelativeTo(node, image);
/*
As the popup is appended directly to the card. We have to
transform the location from the subcard-/svg-space to the
card space.
*/
// let svgRoot = node.closest('svg')
// let svgRoot = node.closest('svg')
let svgPoint = svgRoot.createSVGPoint();
svgPoint.x = position.x;
@@ -8302,7 +8300,7 @@
let point = svgPoint.matrixTransform(matrix);
let closestDiv = node.closest('div');
console.log("closestDiv", closestDiv, point);
console.log('closestDiv', closestDiv, point);
let global = Points.fromNodeToPage(closestDiv, point);
let local = Points.fromPageToNode(context, global);
@@ -8314,7 +8312,7 @@
// we could load the data while the circle is animating.
// but for simplicity it's just done here for now.
// TODO: Adjust to load while animating (Problem: Unload when cancelled).
console.log("loadHighlightPopup", src, position, local);
console.log('loadHighlightPopup', src, position, local);
this._loadPopupContent(src)
.then(content => {
this._openPopup(context, src, local, content, {
+14 -14
View File
@@ -2483,10 +2483,10 @@
});
this.button.on('pointerout', this.onEnd.bind(this));
this.button.on('pointercancel', this.onEnd.bind(this));
this.button.on('pointerupoutside', this.onEnd.bind(this));
this.button.on('pointertap', this.onEnd.bind(this));
this.button.on('scroll', this.onEnd.bind(this));
this.button.on('pointercancel', this.onEnd.bind(this));
this.button.on('pointerupoutside', this.onEnd.bind(this));
this.button.on('pointertap', this.onEnd.bind(this));
this.button.on('scroll', this.onEnd.bind(this));
// eslint-disable-next-line no-unused-vars
this.button.on('pointerdown', e => {
@@ -2919,14 +2919,14 @@
this.icon.tint = value;
}
}
onEnd(event) {
this.capture(event);
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 1,
overwrite: 'none'
});
}
onEnd(event) {
this.capture(event);
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 1,
overwrite: 'none'
});
}
}
/* globals ThrowPropsPlugin, Strong */
@@ -2972,7 +2972,7 @@
* @param {number} [opts.maxWidth] - The maximum width of the button group. If the buttons are wider than the maximum width, the buttons get stacked. Note: The buttons can only be stacked if margin is not zero. Note 2: Load the Greensock ThrowPropsPlugin for smoother animations.
* @param {number} [opts.maxHeight] - The maximum height of the button group. If the buttons are higher than the maximum height, the buttons get stacked. Note: The buttons can only be stacked if margin is not zero. Note 2: Load the Greensock ThrowPropsPlugin for smoother animations.
* @param {number} [opts.stackPadding=10] - The padding for stacked buttons.
* @param {PIXI.Application} [opts.app] - The PixiJS Application. Must be set if you want to use the mousewheel to scroll your button group. Only used when the buttons are stacked (with maxWidth or maxHeight).
* @param {PIXI.Application} [opts.app=window.app] - The PixiJS Application. Must be set if you want to use the mousewheel to scroll your button group. Only used when the buttons are stacked (with maxWidth or maxHeight).
* @param {number} [opts.padding=Theme.padding] - Button: The inner spacing (distance from icon and/or label) the the border.
* @param {number} [opts.margin=Theme.margin] - The outer spacing (distance from one button to the previous/next button).
* @param {string} [opts.iconPosition=left] - Button: The position of the icon in relation to the label. Can be left or right.
@@ -3024,7 +3024,7 @@
maxWidth: null,
maxHeight: null,
stackPadding: 10,
app: null,
app: window.app,
padding: theme.padding,
margin: theme.margin,
iconPosition: 'left', // left, right