mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Move Blockly.utils.dom.SvgElementType to Blockly.utils.Svg (#4285)
* Move SVGElementType to its own file shaving off 2.7KB
This commit is contained in:
@@ -166,7 +166,7 @@ suite('Checkbox Fields', function() {
|
||||
suite('Check Character', function() {
|
||||
function assertCharacter(field, char) {
|
||||
field.fieldGroup_ = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G, {}, null);
|
||||
Blockly.utils.Svg.G, {}, null);
|
||||
field.sourceBlock_ = {
|
||||
RTL: false,
|
||||
rendered: true,
|
||||
|
||||
@@ -98,7 +98,7 @@ suite('Label Serializable Fields', function() {
|
||||
suite('Customizations', function() {
|
||||
function assertHasClass(labelField, cssClass) {
|
||||
labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G, {}, null);
|
||||
Blockly.utils.Svg.G, {}, null);
|
||||
labelField.constants_ = {
|
||||
FIELD_TEXT_BASELINE_Y: 13
|
||||
};
|
||||
@@ -108,7 +108,7 @@ suite('Label Serializable Fields', function() {
|
||||
}
|
||||
function assertDoesNotHaveClass(labelField, cssClass) {
|
||||
labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G, {}, null);
|
||||
Blockly.utils.Svg.G, {}, null);
|
||||
labelField.constants_ = {
|
||||
FIELD_TEXT_BASELINE_Y: 13
|
||||
};
|
||||
@@ -155,7 +155,7 @@ suite('Label Serializable Fields', function() {
|
||||
test('setClass', function() {
|
||||
var field = new Blockly.FieldLabelSerializable();
|
||||
field.fieldGroup_ = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G, {}, null);
|
||||
Blockly.utils.Svg.G, {}, null);
|
||||
field.constants_ = {
|
||||
FIELD_TEXT_BASELINE_Y: 13
|
||||
};
|
||||
|
||||
@@ -98,7 +98,7 @@ suite('Label Fields', function() {
|
||||
suite('Customizations', function() {
|
||||
function assertHasClass(labelField, cssClass) {
|
||||
labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G, {}, null);
|
||||
Blockly.utils.Svg.G, {}, null);
|
||||
labelField.constants_ = {
|
||||
FIELD_TEXT_BASELINE_Y: 13
|
||||
};
|
||||
@@ -108,7 +108,7 @@ suite('Label Fields', function() {
|
||||
}
|
||||
function assertDoesNotHaveClass(labelField, cssClass) {
|
||||
labelField.fieldGroup_ = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G, {}, null);
|
||||
Blockly.utils.Svg.G, {}, null);
|
||||
labelField.constants_ = {
|
||||
FIELD_TEXT_BASELINE_Y: 13
|
||||
};
|
||||
@@ -156,7 +156,7 @@ suite('Label Fields', function() {
|
||||
test('setClass', function() {
|
||||
var field = new Blockly.FieldLabel();
|
||||
field.fieldGroup_ = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G, {}, null);
|
||||
Blockly.utils.Svg.G, {}, null);
|
||||
field.constants_ = {
|
||||
FIELD_TEXT_BASELINE_Y: 13
|
||||
};
|
||||
|
||||
@@ -46,12 +46,12 @@ var svgSpace;
|
||||
|
||||
function addPathAt(path, x, y) {
|
||||
var group = Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.G,
|
||||
Blockly.utils.Svg.G,
|
||||
{
|
||||
'transform': 'translate(' + (x + 50) + ', ' + y + ')'
|
||||
}, svgSpace);
|
||||
Blockly.utils.dom.createSvgElement(
|
||||
Blockly.utils.dom.SvgElementType.PATH, {
|
||||
Blockly.utils.Svg.PATH, {
|
||||
'd': 'M 0,0 ' + path,
|
||||
'marker-start': 'url(#startDot)',
|
||||
'marker-end': 'url(#endDot)',
|
||||
|
||||
Reference in New Issue
Block a user