mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-15 17:37:30 +01:00
Merge pull request #179 from arillo/feature/paste-in-place
check for isShift to paste in place
This commit is contained in:
@@ -8,6 +8,8 @@ var SpacedeckSections = {
|
|||||||
data: {
|
data: {
|
||||||
MAX_COLUMNS: 20,
|
MAX_COLUMNS: 20,
|
||||||
|
|
||||||
|
isShift: false,
|
||||||
|
|
||||||
redo_stack: [],
|
redo_stack: [],
|
||||||
undo_stack: [],
|
undo_stack: [],
|
||||||
|
|
||||||
@@ -206,7 +208,9 @@ var SpacedeckSections = {
|
|||||||
Mousetrap.bind('shift+left', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(-10,0,evt);}) }.bind(this));
|
Mousetrap.bind('shift+left', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(-10,0,evt);}) }.bind(this));
|
||||||
Mousetrap.bind('shift+right', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(10,0,evt);}) }.bind(this));
|
Mousetrap.bind('shift+right', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(10,0,evt);}) }.bind(this));
|
||||||
Mousetrap.bind('space', function(evt) { this.activate_pan_tool(evt); }.bind(this));
|
Mousetrap.bind('space', function(evt) { this.activate_pan_tool(evt); }.bind(this));
|
||||||
|
Mousetrap.bind(['shift'], function(evt) { this.isShift = true; }.bind(this), 'keydown');
|
||||||
|
Mousetrap.bind(['shift'], function(evt) { this.isShift = false; }.bind(this), 'keyup');
|
||||||
|
Mousetrap.bind('shift+up', function(evt) { this.if_editable(function() {this.nudge_selected_artifacts(0,-10,evt);}) }.bind(this));
|
||||||
$(document).bind("beforecopy", this.handle_onbeforecopy.bind(this));
|
$(document).bind("beforecopy", this.handle_onbeforecopy.bind(this));
|
||||||
$(window).bind("beforeunload", this.handle_onunload.bind(this));
|
$(window).bind("beforeunload", this.handle_onunload.bind(this));
|
||||||
$(window).bind("resize", this.handle_window_resize.bind(this));
|
$(window).bind("resize", this.handle_window_resize.bind(this));
|
||||||
@@ -2292,17 +2296,19 @@ var SpacedeckSections = {
|
|||||||
for (var i=0; i<parsed.length; i++) {
|
for (var i=0; i<parsed.length; i++) {
|
||||||
if (parsed[i].mime) {
|
if (parsed[i].mime) {
|
||||||
var z = this.highest_z()+1;
|
var z = this.highest_z()+1;
|
||||||
if (parsed.length==1) {
|
if(!this.isShift) {
|
||||||
var w = parsed[i].w;
|
if (parsed.length==1) {
|
||||||
var h = parsed[i].h;
|
var w = parsed[i].w;
|
||||||
var point = this.find_place_for_item(w,h);
|
var h = parsed[i].h;
|
||||||
parsed[i].x = point.x;
|
var point = this.find_place_for_item(w,h);
|
||||||
parsed[i].y = point.y;
|
parsed[i].x = point.x;
|
||||||
parsed[i].z = point.z;
|
parsed[i].y = point.y;
|
||||||
} else {
|
parsed[i].z = point.z;
|
||||||
parsed[i].x = parsed[i].x+50;
|
} else {
|
||||||
parsed[i].y = parsed[i].y+50;
|
parsed[i].x = parsed[i].x+100;
|
||||||
parsed[i].y = parsed[i].z+z;
|
parsed[i].y = parsed[i].y+100;
|
||||||
|
parsed[i].y = parsed[i].z+z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.clone_artifact(parsed[i], 0,0, function(a) {
|
this.clone_artifact(parsed[i], 0,0, function(a) {
|
||||||
this.multi_select([a]);
|
this.multi_select([a]);
|
||||||
|
|||||||
Reference in New Issue
Block a user