Skip to content

Instantly share code, notes, and snippets.

@A
Created June 20, 2014 12:53
Show Gist options
  • Save A/076b62bf131ecc0294e5 to your computer and use it in GitHub Desktop.
Save A/076b62bf131ecc0294e5 to your computer and use it in GitHub Desktop.
{
initialize: function () {
kb.on('ctrl + c', this.trigger.bind(this, 'copy'));
kb.on('command + c', this.trigger.bind(this, 'copy'));
kb.on('delete, backspace', this.trigger.bind(this, 'delete'));
},
trigger: function (type, event, data) {
if ($(':focus').length) { return; } // fix для того, чтобы
event.preventDefault();
if ('copy' === type) { window.bufferCPE = []; }
$('.js-canvas').find('.selected').each(function (i, el) {
$(el).trigger(type);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment