Merge fe6a8e36f8
into 98081097b4
This commit is contained in:
commit
1219c5681f
2 changed files with 28 additions and 4 deletions
|
@ -357,10 +357,8 @@ const Create = {
|
|||
Create.newSynapse.description = $(this).val()
|
||||
})
|
||||
|
||||
$('#synapse_desc').focusout(function() {
|
||||
if (Create.newSynapse.beingCreated) {
|
||||
Synapse.createSynapseLocally()
|
||||
}
|
||||
$('#synapse_desc').focusout(function(e) {
|
||||
Create.newSynapse.hide()
|
||||
})
|
||||
|
||||
$('#synapse_desc').keydown(function(e) {
|
||||
|
|
|
@ -33,6 +33,7 @@ const JIT = {
|
|||
dragFlag: 0,
|
||||
dragTolerance: 0,
|
||||
virtualPointer: {},
|
||||
autoCreateSynapseTimeoutId: null,
|
||||
|
||||
events: {
|
||||
topicDrag: 'Metamaps:JIT:events:topicDrag',
|
||||
|
@ -864,7 +865,28 @@ const JIT = {
|
|||
})
|
||||
temp.setData('dim', 35, 'current')
|
||||
Visualize.mGraph.plot()
|
||||
|
||||
// if they hold the mouse over the topic, auto create the synapse after 1000ms
|
||||
if (JIT.autoCreateSynapseTimeoutId === null) {
|
||||
JIT.autoCreateSynapseTimeoutId = window.setTimeout(() => {
|
||||
Create.newSynapse.description = ''
|
||||
Create.newSynapse.topic2id = temp.getData('topic').id
|
||||
Synapse.createSynapseLocally()
|
||||
|
||||
JIT.tempNode = null
|
||||
JIT.tempNode2 = null
|
||||
JIT.tempInit = false
|
||||
Mouse.synapseStartCoordinates = []
|
||||
Mouse.synapseEndCoordinates = null
|
||||
temp.setData('dim', 25, 'current')
|
||||
|
||||
JIT.autoCreateSynapseTimeoutId = null
|
||||
}, 1000)
|
||||
}
|
||||
} else if (!temp) {
|
||||
window.clearTimeout(JIT.autoCreateSynapseTimeoutId)
|
||||
JIT.autoCreateSynapseTimeoutId = null
|
||||
|
||||
JIT.tempNode2 = null
|
||||
Visualize.mGraph.graph.eachNode(function(n) {
|
||||
n.setData('dim', 25, 'current')
|
||||
|
@ -895,6 +917,8 @@ const JIT = {
|
|||
if (JIT.tempNode2) JIT.tempNode2.setData('dim', 25, 'current')
|
||||
JIT.tempNode2 = null
|
||||
JIT.tempInit = false
|
||||
window.clearTimeout(JIT.autoCreateSynapseTimeoutId)
|
||||
JIT.autoCreateSynapseTimeoutId = null
|
||||
// reset the draw synapse positions to false
|
||||
Mouse.synapseStartCoordinates = []
|
||||
Mouse.synapseEndCoordinates = null
|
||||
|
@ -936,6 +960,8 @@ const JIT = {
|
|||
$('#new_synapse').css('left', pixelPos.x + 'px')
|
||||
$('#new_synapse').css('top', pixelPos.y + 'px')
|
||||
Create.newSynapse.open()
|
||||
window.clearTimeout(JIT.autoCreateSynapseTimeoutId)
|
||||
JIT.autoCreateSynapseTimeoutId = null
|
||||
JIT.tempNode = null
|
||||
JIT.tempNode2 = null
|
||||
JIT.tempInit = false
|
||||
|
|
Loading…
Add table
Reference in a new issue