Skip to content

Commit

Permalink
Update sorter events
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Nov 9, 2017
1 parent 4aa3ba7 commit 8e03bdc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions dist/grapes.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grapesjs",
"description": "Free and Open Source Web Builder Framework",
"version": "0.12.28",
"version": "0.12.29",
"author": "Artur Arseniev",
"license": "BSD-3-Clause",
"homepage": "http://grapesjs.com",
Expand Down
13 changes: 7 additions & 6 deletions src/utils/Sorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ module.exports = Backbone.View.extend({
em && em.clearSelection();
this.toggleSortCursor(1);

em && em.trigger('component:drag-start', src, srcModel);
em && em.trigger('sorter:drag:start', src, srcModel);
},

/**
Expand Down Expand Up @@ -391,7 +391,7 @@ module.exports = Backbone.View.extend({
if(typeof this.onMoveClb === 'function')
this.onMoveClb(e);

em && em.trigger('component:drag', {
em && em.trigger('sorter:drag', {
target,
targetModel,
dims,
Expand Down Expand Up @@ -544,7 +544,7 @@ module.exports = Backbone.View.extend({

// Check if the source is valid with the target
let validResult = this.validTarget(target);
em && em.trigger('component:drag-validation', validResult);
em && em.trigger('sorter:drag:validation', validResult);

if (!validResult.valid && this.targetP) {
return this.dimsFromTarget(this.targetP, rX, rY);
Expand Down Expand Up @@ -617,7 +617,7 @@ module.exports = Backbone.View.extend({
// If the current target is not valid (src/trg reasons) try with
// the parent one (if exists)
const validResult = this.validTarget(target);
em && em.trigger('component:drag-validation', validResult);
em && em.trigger('sorter:drag:validation', validResult);

if (!validResult.valid && targetParent) {
return this.getTargetFromEl(targetParent);
Expand Down Expand Up @@ -930,7 +930,7 @@ module.exports = Backbone.View.extend({
* */
move(dst, src, pos) {
var em = this.em;
em && em.trigger('component:dragEnd:before', dst, src, pos);
em && em.trigger('component:dragEnd:before', dst, src, pos); // @depricated
var warns = [];
var index = pos.index;
var modelToDrop, modelTemp, created;
Expand Down Expand Up @@ -986,7 +986,8 @@ module.exports = Backbone.View.extend({
console.warn('Invalid target position: ' + warns.join(', '));
}

em && em.trigger('component:dragEnd', targetCollection, modelToDrop, warns);
em && em.trigger('component:dragEnd', targetCollection, modelToDrop, warns); // @depricated
em && em.trigger('sorter:drag:end', targetCollection, modelToDrop, warns);

return created;
},
Expand Down

0 comments on commit 8e03bdc

Please sign in to comment.