Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(TS): utils #8230

Merged
merged 37 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
047b4c8
getById
asturur Sep 1, 2022
8696f5e
this is fine
asturur Sep 1, 2022
aa90704
remove toArray
asturur Sep 1, 2022
debadac
addClass removed for classList.add)
asturur Sep 1, 2022
2807ec2
Merge branch 'master' into see-where-i-broke
asturur Sep 1, 2022
77b0727
ok?
asturur Sep 1, 2022
d2ac909
Revert "ok?"
asturur Sep 1, 2022
f46feee
Revert "addClass removed for classList.add)"
asturur Sep 1, 2022
bc9962c
rotate point
asturur Sep 1, 2022
bf8efa2
shadow with real point
asturur Sep 1, 2022
bfe92fd
added point rotation explict test
asturur Sep 1, 2022
0eb7947
Squashed commit of the following:
ShaMan123 Sep 1, 2022
cdf5992
put back some old logic
asturur Sep 1, 2022
a7a3026
handle wrapelement
asturur Sep 1, 2022
6bb4d2b
handle wrapelement
asturur Sep 1, 2022
4e3939f
fix tests
asturur Sep 1, 2022
92bee80
change the export
asturur Sep 1, 2022
d2e8f05
moved limitDimByArea
asturur Sep 1, 2022
3cd1da1
moving isTransparent
asturur Sep 1, 2022
45a46a4
moved mergeClipPaths
asturur Sep 1, 2022
7ecd0c5
fixed export and colon
asturur Sep 1, 2022
0232258
export ease
asturur Sep 1, 2022
33f18bc
animate color
asturur Sep 1, 2022
f363dfe
Update src/util/misc/mergeClipPaths.ts
asturur Sep 2, 2022
c1eb748
night commit
asturur Sep 2, 2022
1ea46cb
Merge branch 'see-where-i-broke' of github.com:fabricjs/fabric.js int…
asturur Sep 2, 2022
26a1acf
moved
asturur Sep 2, 2022
cc95956
clarify breakage
asturur Sep 2, 2022
612b5d1
removed var
asturur Sep 2, 2022
fbe5f75
converted animate
asturur Sep 2, 2022
585b0e6
only change export for createClass
asturur Sep 2, 2022
cabb1c6
fixes
asturur Sep 2, 2022
7c99ce5
ok passes
asturur Sep 2, 2022
cd54755
typed anim_ease
asturur Sep 2, 2022
5ce2a09
use `sendObjectToPlane`
ShaMan123 Sep 3, 2022
a5d5441
Revert "use `sendObjectToPlane`"
asturur Sep 3, 2022
ca6f6b9
add back the optional setTimeout
asturur Sep 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/canvas.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ import { Point } from './point.class';
upperCanvasEl = this._createCanvasElement();
this.upperCanvasEl = upperCanvasEl;
}
fabric.util.addClass(upperCanvasEl, 'upper-canvas ' + lowerCanvasClass);
upperCanvasEl.classList.add('upper-canvas ' + lowerCanvasClass);
ShaMan123 marked this conversation as resolved.
Show resolved Hide resolved
this.upperCanvasEl.setAttribute('data-fabric', 'top');
this.wrapperEl.appendChild(upperCanvasEl);

Expand Down
3 changes: 2 additions & 1 deletion src/shapes/image.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@
*/
_initElement: function(element, options) {
this.setElement( fabric.document.getElementById(element) || element, options);
fabric.util.addClass(this.getElement(), fabric.Image.CSS_CANVAS);
const newEl = this.getElement()
newEl.classList.add(fabric.Image.CSS_CANVAS);
},

/**
Expand Down
2 changes: 1 addition & 1 deletion src/static_canvas.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ import { pick } from './util/misc/pick';
throw new Error('fabric.js: trying to initialize a canvas that has already been initialized');
/* _DEV_MODE_END_ */
}
fabric.util.addClass(this.lowerCanvasEl, 'lower-canvas');
this.lowerCanvasEl.classList.add('lower-canvas');
this.lowerCanvasEl.setAttribute('data-fabric', 'main');
if (this.interactive) {
this._originalCanvasStyle = this.lowerCanvasEl.style.cssText;
Expand Down
18 changes: 0 additions & 18 deletions test/unit/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,6 @@
assert.equal(el.getAttribute('some_random-attribute'), 'woot');
});

QUnit.test('fabric.util.addClass', function(assert) {
var addClass = fabric.util.addClass;
assert.ok(typeof addClass === 'function');

var el = fabric.document.createElement('div');
addClass(el, 'foo');
assert.equal(el.className, 'foo');

addClass(el, 'bar');
assert.equal(el.className, 'foo bar');

addClass(el, 'baz qux');
assert.equal(el.className, 'foo bar baz qux');

addClass(el, 'foo');
assert.equal(el.className, 'foo bar baz qux');
});

QUnit.test('fabric.util.wrapElement', function(assert) {
var wrapElement = fabric.util.wrapElement;
assert.ok(typeof wrapElement === 'function');
Expand Down