Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/projects/behavior-project-boards.js
Show First 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | JX.Stratcom.listen( | ||||
statics.boardID = new_config.boardID; | statics.boardID = new_config.boardID; | ||||
} | } | ||||
update_statics(new_config); | update_statics(new_config); | ||||
if (data.fromServer) { | if (data.fromServer) { | ||||
init_board(); | init_board(); | ||||
} | } | ||||
}); | }); | ||||
// When the user drags the workboard background, pan the workboard | |||||
// horizontally. This allows you to scroll across cards with only the | |||||
// mouse, without shift + scrollwheel or using the scrollbar. | |||||
var pan_origin = null; | |||||
var pan_node = null; | |||||
var pan_x = null; | |||||
JX.Stratcom.listen('mousedown', 'workboard-shadow', function(e) { | |||||
if (!JX.Device.isDesktop()) { | |||||
return; | |||||
} | |||||
if (e.getNode('workpanel')) { | |||||
return; | |||||
} | |||||
if (JX.Stratcom.pass()) { | |||||
return; | |||||
} | |||||
e.kill(); | |||||
pan_origin = JX.$V(e); | |||||
pan_node = e.getNode('workboard-shadow'); | |||||
pan_x = pan_node.scrollLeft; | |||||
}); | |||||
JX.Stratcom.listen('mousemove', null, function(e) { | |||||
if (!pan_origin) { | |||||
return; | |||||
} | |||||
var cursor = JX.$V(e); | |||||
pan_node.scrollLeft = pan_x + (pan_origin.x - cursor.x); | |||||
}); | |||||
JX.Stratcom.listen('mouseup', null, function() { | |||||
pan_origin = null; | |||||
}); | |||||
return true; | return true; | ||||
} | } | ||||
if (!statics.setup) { | if (!statics.setup) { | ||||
update_statics(config); | update_statics(config); | ||||
var current_page_id = JX.Quicksand.getCurrentPageID(); | var current_page_id = JX.Quicksand.getCurrentPageID(); | ||||
statics.boardConfigCache = {}; | statics.boardConfigCache = {}; | ||||
statics.boardConfigCache[current_page_id] = config; | statics.boardConfigCache[current_page_id] = config; | ||||
Show All 11 Lines |