fixed preferences, fixed windows handles
This commit is contained in:
@@ -101,6 +101,14 @@ class EICController extends Controller {
|
||||
</div>
|
||||
</header>
|
||||
<section></section>
|
||||
<div class="handle" data-side="nw"></div>
|
||||
<div class="handle" data-side="n"></div>
|
||||
<div class="handle" data-side="ne"></div>
|
||||
<div class="handle" data-side="e"></div>
|
||||
<div class="handle" data-side="se"></div>
|
||||
<div class="handle" data-side="s"></div>
|
||||
<div class="handle" data-side="sw"></div>
|
||||
<div class="handle" data-side="w"></div>
|
||||
</div>`);
|
||||
if(options.expanded) content.setAttribute('expanded','');
|
||||
if(options.windowStyle){
|
||||
|
||||
@@ -142,9 +142,8 @@ class EICDomContent extends View {
|
||||
|
||||
resizable(element, onResize) {
|
||||
let mouseX, mouseY, offset = 0, offsetY = 0, grab = '';
|
||||
|
||||
// mouse button down over the element
|
||||
element.addEventListener('mousedown', onMouseDown);
|
||||
|
||||
element.querySelectorAll(':scope > .handle').forEach(handle => handle.addEventListener('mousedown', onMouseDown))
|
||||
|
||||
element.querySelector('section').addEventListener('mousedown', onBlockMouseDown);
|
||||
|
||||
@@ -157,17 +156,15 @@ class EICDomContent extends View {
|
||||
function onMouseDown(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
if(event.currentTarget.hasAttribute('expanded')) return false;
|
||||
|
||||
if(event.currentTarget.parentElement.hasAttribute('expanded')) return false;
|
||||
|
||||
let limits = element.getBoundingClientRect();
|
||||
|
||||
mouseX = event.clientX;
|
||||
mouseY = event.clientY;
|
||||
|
||||
grab = '';
|
||||
grab += (Math.abs(mouseY - limits.y) < Math.abs(mouseY - (limits.bottom))) ? 'n':'s';
|
||||
grab += (Math.abs(mouseX - limits.x) < Math.abs(mouseX - (limits.right))) ? 'e':'w';
|
||||
grab = event.currentTarget.dataset.side
|
||||
|
||||
offset = element.getBoundingClientRect();
|
||||
|
||||
@@ -207,11 +204,11 @@ class EICDomContent extends View {
|
||||
if(grab.indexOf('s') > -1) {
|
||||
offset.height = offset.height + dy;
|
||||
}
|
||||
if(grab.indexOf('e') > -1) {
|
||||
if(grab.indexOf('w') > -1) {
|
||||
offset.x = offset.x + dx;
|
||||
offset.width = offset.width - dx;
|
||||
}
|
||||
if(grab.indexOf('w') > -1) {
|
||||
if(grab.indexOf('e') > -1) {
|
||||
offset.width = offset.width + dx;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -228,7 +228,8 @@ class myUser extends app.LoadedClasses.User {
|
||||
if(app.MessageBus) {
|
||||
app.MessageBus.requestWssGwAction('GET', { key: `${this.identity.uuid}:userPrefs`})
|
||||
.then(settings => {
|
||||
this.preferences = settings.value;
|
||||
console.log("Prefs received from bus:", settings)
|
||||
this.preferences = settings.value || {}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -271,7 +272,7 @@ class myUser extends app.LoadedClasses.User {
|
||||
if(app.MessageBus) {
|
||||
let segments = path.split('.');
|
||||
|
||||
console.log('=====>',this, this.preferences)
|
||||
console.log('=====>',this, this.preferences)
|
||||
let pointer = this.preferences;
|
||||
|
||||
for(let i = 0; i < segments.length - 1; i++) {
|
||||
|
||||
Reference in New Issue
Block a user