fixes
This commit is contained in:
@@ -943,22 +943,22 @@ editor.init = () => {
|
|||||||
$('#layerlist td.layername')
|
$('#layerlist td.layername')
|
||||||
.mouseup(function (evt) {
|
.mouseup(function (evt) {
|
||||||
$('#layerlist tr.layer').removeClass('layersel');
|
$('#layerlist tr.layer').removeClass('layersel');
|
||||||
$(this.parentNode).addClass('layersel');
|
$(evt.currentTarget.parentNode).addClass('layersel');
|
||||||
svgCanvas.setCurrentLayer(this.textContent);
|
svgCanvas.setCurrentLayer(evt.currentTarget.textContent);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
})
|
})
|
||||||
.mouseover(() => {
|
.mouseover((evt) => {
|
||||||
toggleHighlightLayer(this.textContent);
|
toggleHighlightLayer(evt.currentTarget.textContent);
|
||||||
})
|
})
|
||||||
.mouseout(() => {
|
.mouseout(() => {
|
||||||
toggleHighlightLayer();
|
toggleHighlightLayer();
|
||||||
});
|
});
|
||||||
$('#layerlist td.layervis').click(() => {
|
$('#layerlist td.layervis').click((evt) => {
|
||||||
const row = $(this.parentNode).prevAll().length;
|
const row = $(evt.currentTarget.parentNode).prevAll().length;
|
||||||
const name = $('#layerlist tr.layer:eq(' + row + ') td.layername').text();
|
const name = $('#layerlist tr.layer:eq(' + row + ') td.layername').text();
|
||||||
const vis = $(this).hasClass('layerinvis');
|
const vis = $(evt.currentTarget).hasClass('layerinvis');
|
||||||
svgCanvas.setLayerVisibility(name, vis);
|
svgCanvas.setLayerVisibility(name, vis);
|
||||||
$(this).toggleClass('layerinvis');
|
$(evt.currentTarget).toggleClass('layerinvis');
|
||||||
});
|
});
|
||||||
|
|
||||||
// if there were too few rows, let's add a few to make it not so lonely
|
// if there were too few rows, let's add a few to make it not so lonely
|
||||||
@@ -2045,8 +2045,8 @@ editor.init = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$('#cur_context_panel').delegate('a', 'click', () => {
|
$('#cur_context_panel').delegate('a', 'click', (evt) => {
|
||||||
const link = $(this);
|
const link = $(evt.currentTarget);
|
||||||
if (link.attr('data-root')) {
|
if (link.attr('data-root')) {
|
||||||
svgCanvas.leaveContext();
|
svgCanvas.leaveContext();
|
||||||
} else {
|
} else {
|
||||||
@@ -2352,21 +2352,21 @@ editor.init = () => {
|
|||||||
svgCanvas.setBlur(e.target.value / 10, true);
|
svgCanvas.setBlur(e.target.value / 10, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
$('#stroke_style').change(() => {
|
$('#stroke_style').change((evt) => {
|
||||||
svgCanvas.setStrokeAttr('stroke-dasharray', $(this).val());
|
svgCanvas.setStrokeAttr('stroke-dasharray', $(evt.currentTarget).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#stroke_linejoin').change(() => {
|
$('#stroke_linejoin').change((evt) => {
|
||||||
svgCanvas.setStrokeAttr('stroke-linejoin', $(this).val());
|
svgCanvas.setStrokeAttr('stroke-linejoin', $(evt.currentTarget).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
// Lose focus for select elements when changed (Allows keyboard shortcuts to work better)
|
// Lose focus for select elements when changed (Allows keyboard shortcuts to work better)
|
||||||
$('select').change(() => { $(this).blur(); });
|
$('select').change((evt) => { $(evt.currentTarget).blur(); });
|
||||||
|
|
||||||
// fired when user wants to move elements to another layer
|
// fired when user wants to move elements to another layer
|
||||||
let promptMoveLayerOnce = false;
|
let promptMoveLayerOnce = false;
|
||||||
$('#selLayerNames').change(async () => {
|
$('#selLayerNames').change(async (evt) => {
|
||||||
const destLayer = this.options[this.selectedIndex].value;
|
const destLayer = evt.currentTarget.options[evt.currentTarget.selectedIndex].value;
|
||||||
const confirmStr = uiStrings.notification.QmoveElemsToLayer.replace('%s', destLayer);
|
const confirmStr = uiStrings.notification.QmoveElemsToLayer.replace('%s', destLayer);
|
||||||
/**
|
/**
|
||||||
* @param {boolean} ok
|
* @param {boolean} ok
|
||||||
@@ -2392,32 +2392,32 @@ editor.init = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#font_family').change(() => {
|
$('#font_family').change((evt) => {
|
||||||
svgCanvas.setFontFamily(this.value);
|
svgCanvas.setFontFamily(evt.currentTarget.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#seg_type').change(() => {
|
$('#seg_type').change((evt) => {
|
||||||
svgCanvas.setSegType($(this).val());
|
svgCanvas.setSegType($(evt.currentTarget).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#text').bind('keyup input', () => {
|
$('#text').bind('keyup input', (evt) => {
|
||||||
svgCanvas.setTextContent(this.value);
|
svgCanvas.setTextContent(evt.currentTarget.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#image_url').change(() => {
|
$('#image_url').change((evt) => {
|
||||||
setImageURL(this.value);
|
setImageURL(evt.currentTarget.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#link_url').change(() => {
|
$('#link_url').change((evt) => {
|
||||||
if (this.value.length) {
|
if (evt.currentTarget.value.length) {
|
||||||
svgCanvas.setLinkURL(this.value);
|
svgCanvas.setLinkURL(evt.currentTarget.value);
|
||||||
} else {
|
} else {
|
||||||
svgCanvas.removeHyperlink();
|
svgCanvas.removeHyperlink();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#g_title').change(() => {
|
$('#g_title').change((evt) => {
|
||||||
svgCanvas.setGroupTitle(this.value);
|
svgCanvas.setGroupTitle(evt.currentTarget.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
const attrChanger = function (e) {
|
const attrChanger = function (e) {
|
||||||
@@ -2458,13 +2458,13 @@ editor.init = () => {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
$('.attr_changer').change(() => {
|
$('.attr_changer').change((evt) => {
|
||||||
const attr = this.getAttribute('data-attr');
|
const attr = evt.currentTarget.getAttribute('data-attr');
|
||||||
let val = this.value;
|
let val = evt.currentTarget.value;
|
||||||
const valid = isValidUnit(attr, val, selectedElement);
|
const valid = isValidUnit(attr, val, selectedElement);
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
this.value = selectedElement.getAttribute(attr);
|
evt.currentTarget.value = selectedElement.getAttribute(attr);
|
||||||
/* await */ $.alert(uiStrings.notification.invalidAttrValGiven);
|
/* await */ $.alert(uiStrings.notification.invalidAttrValGiven);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2493,7 +2493,7 @@ editor.init = () => {
|
|||||||
} else {
|
} else {
|
||||||
svgCanvas.changeSelectedAttribute(attr, val);
|
svgCanvas.changeSelectedAttribute(attr, val);
|
||||||
}
|
}
|
||||||
this.blur();
|
evt.currentTarget.blur();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2626,8 +2626,8 @@ editor.init = () => {
|
|||||||
if (jsHover) {
|
if (jsHover) {
|
||||||
listItems.mouseover(() => {
|
listItems.mouseover(() => {
|
||||||
this.style.backgroundColor = '#FFC';
|
this.style.backgroundColor = '#FFC';
|
||||||
}).mouseout(() => {
|
}).mouseout((evt) => {
|
||||||
this.style.backgroundColor = 'transparent';
|
evt.currentTarget.style.backgroundColor = 'transparent';
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user