disabled awkward panning and zooming bugs by editing jit code
This commit is contained in:
parent
8260fdf7e0
commit
e5076533c0
8 changed files with 450 additions and 424 deletions
|
@ -57,7 +57,7 @@ function graphSettings(type) {
|
||||||
},
|
},
|
||||||
//Update node positions when dragged
|
//Update node positions when dragged
|
||||||
onDragMove: function (node, eventInfo, e) {
|
onDragMove: function (node, eventInfo, e) {
|
||||||
clickDragOnTopic(node, eventInfo, e);
|
clickDragOnTopic(node, eventInfo, e);
|
||||||
},
|
},
|
||||||
onDragEnd: function() {
|
onDragEnd: function() {
|
||||||
if (tempInit && tempNode2 == null) {
|
if (tempInit && tempNode2 == null) {
|
||||||
|
@ -196,7 +196,7 @@ function graphSettings(type) {
|
||||||
},
|
},
|
||||||
//Update node positions when dragged
|
//Update node positions when dragged
|
||||||
onDragMove: function (node, eventInfo, e) {
|
onDragMove: function (node, eventInfo, e) {
|
||||||
clickDragOnTopic(node, eventInfo, e);
|
clickDragOnTopic(node, eventInfo, e);
|
||||||
},
|
},
|
||||||
onDragEnd: function() {
|
onDragEnd: function() {
|
||||||
if (tempInit && tempNode2 == null) {
|
if (tempInit && tempNode2 == null) {
|
||||||
|
@ -557,7 +557,6 @@ function onCreateLabelHandler(domElement, node) {
|
||||||
height="50" \
|
height="50" \
|
||||||
width="50" \
|
width="50" \
|
||||||
src="$_imgsrc_$" /> \
|
src="$_imgsrc_$" /> \
|
||||||
<div class="scroll"> \
|
|
||||||
<span class="title"> \
|
<span class="title"> \
|
||||||
<span class="best_in_place best_in_place_name" \
|
<span class="best_in_place best_in_place_name" \
|
||||||
data-url="/topics/$_id_$" \
|
data-url="/topics/$_id_$" \
|
||||||
|
@ -575,6 +574,7 @@ function onCreateLabelHandler(domElement, node) {
|
||||||
Added by: <a href="/users/$_userid_$" target="_blank">$_username_$ \
|
Added by: <a href="/users/$_userid_$" target="_blank">$_username_$ \
|
||||||
</a> \
|
</a> \
|
||||||
</div> \
|
</div> \
|
||||||
|
<div class="scroll"> \
|
||||||
<div class="desc"> \
|
<div class="desc"> \
|
||||||
<span class="best_in_place best_in_place_desc" \
|
<span class="best_in_place best_in_place_desc" \
|
||||||
data-url="/topics/$_id_$" \
|
data-url="/topics/$_id_$" \
|
||||||
|
@ -593,6 +593,7 @@ function onCreateLabelHandler(domElement, node) {
|
||||||
data-object="topic" \
|
data-object="topic" \
|
||||||
data-attribute="link" \
|
data-attribute="link" \
|
||||||
data-type="input">$_link_$</span>$_close_a_tag_$ \
|
data-type="input">$_link_$</span>$_close_a_tag_$ \
|
||||||
|
<div class="clearfloat"></div> \
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
//link is rendered differently if user is logged out or in
|
//link is rendered differently if user is logged out or in
|
||||||
|
|
|
@ -2585,6 +2585,9 @@ Extras.Classes.Navigation = new Class({
|
||||||
|
|
||||||
onMouseWheel: function(e, win, scroll) {
|
onMouseWheel: function(e, win, scroll) {
|
||||||
if(!this.config.zooming) return;
|
if(!this.config.zooming) return;
|
||||||
|
// START METAMAPS CODE
|
||||||
|
if (e.target.id != 'infovis-canvas') return;
|
||||||
|
// END METAMAPS CODE
|
||||||
$.event.stop($.event.get(e, win));
|
$.event.stop($.event.get(e, win));
|
||||||
var val = this.config.zooming / 1000,
|
var val = this.config.zooming / 1000,
|
||||||
ans = 1 + scroll * val;
|
ans = 1 + scroll * val;
|
||||||
|
@ -2611,6 +2614,12 @@ Extras.Classes.Navigation = new Class({
|
||||||
if(!this.config.panning) return;
|
if(!this.config.panning) return;
|
||||||
if(!this.pressed) return;
|
if(!this.pressed) return;
|
||||||
if(this.config.panning == 'avoid nodes' && eventInfo.getNode()) return;
|
if(this.config.panning == 'avoid nodes' && eventInfo.getNode()) return;
|
||||||
|
// START METAMAPS CODE
|
||||||
|
if (e.target.id != 'infovis-canvas') {
|
||||||
|
this.pressed = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// END METAMAPS CODE
|
||||||
var thispos = this.pos,
|
var thispos = this.pos,
|
||||||
currentPos = eventInfo.getPos(),
|
currentPos = eventInfo.getPos(),
|
||||||
canvas = this.canvas,
|
canvas = this.canvas,
|
||||||
|
|
|
@ -33,6 +33,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null,
|
||||||
$('#topic_name').bind('railsAutocomplete.select', function(event, data){
|
$('#topic_name').bind('railsAutocomplete.select', function(event, data){
|
||||||
if (data.item.id != undefined) {
|
if (data.item.id != undefined) {
|
||||||
$('#topic_grabTopic').val(data.item.id);
|
$('#topic_grabTopic').val(data.item.id);
|
||||||
|
$('.new_topic').submit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -127,27 +127,19 @@
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add code that makes up and down arrows scroll through.
|
// Add code that makes tab and shift+tab scroll through metacodes
|
||||||
$('.new_topic').bind('keydown keypress',this,function(event) {
|
$('.new_topic').bind('keydown',this,function(event){
|
||||||
//console.log(event)
|
if (event.keyCode == 9 || (event.keyCode == 9 && event.shiftKey)) {
|
||||||
if (event.keyCode == 38 || event.keyCode == 40)
|
event.preventDefault();
|
||||||
{
|
|
||||||
//e.preventDefault();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('.new_topic').bind('keyup',this,function(event){
|
$('.new_topic').bind('keyup',this,function(event){
|
||||||
console.log(event);
|
//console.log(event);
|
||||||
/*key navigation through elements*/
|
/*key navigation through elements*/
|
||||||
if (event.keyCode == 38 || event.keyCode == 40) {
|
if (event.keyCode == 9 && event.shiftKey) {
|
||||||
switch ( event.keyCode ) {
|
event.data.rotate(-1);
|
||||||
case 38: // Up
|
} else if (event.keyCode == 9) {
|
||||||
event.data.rotate(-1);
|
event.data.rotate(1);
|
||||||
break;
|
|
||||||
case 40: // Down
|
|
||||||
event.data.rotate(1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
.CardOnGraph .scroll {
|
.CardOnGraph .scroll {
|
||||||
display:block;
|
display:block;
|
||||||
height:283px;
|
height:232px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .type {
|
.CardOnGraph .type {
|
||||||
|
@ -71,6 +71,15 @@
|
||||||
padding-bottom:5px;
|
padding-bottom:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.CardOnGraph .best_in_place_name {
|
||||||
|
max-width:130px;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CardOnGraph .best_in_place_name input{
|
||||||
|
max-width:130px;
|
||||||
|
}
|
||||||
|
|
||||||
.CardOnGraph .desc {
|
.CardOnGraph .desc {
|
||||||
font-size:15px;
|
font-size:15px;
|
||||||
font-family:Arial, Helvetica, sans-serif;
|
font-family:Arial, Helvetica, sans-serif;
|
||||||
|
@ -81,28 +90,47 @@
|
||||||
margin-top:5px;
|
margin-top:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .link {
|
|
||||||
position:absolute;
|
|
||||||
width:170px;
|
|
||||||
top:295px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CardOnGraph .best_in_place_desc {
|
|
||||||
width:160px;
|
|
||||||
height:180px;
|
|
||||||
display:block;
|
|
||||||
margin-top:2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CardOnGraph .best_in_place_desc input {
|
.CardOnGraph .best_in_place_desc input {
|
||||||
float: right;
|
float: right;
|
||||||
margin: 2px 0px 0px 2px;
|
margin: 2px 0px 0px 2px;
|
||||||
padding: 1px 5px;
|
padding: 1px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.CardOnGraph .best_in_place_desc {
|
||||||
|
width:140px;
|
||||||
|
display:block;
|
||||||
|
margin-top:2px;
|
||||||
|
}
|
||||||
|
|
||||||
.CardOnGraph .best_in_place_desc input[value="Save"] {
|
.CardOnGraph .best_in_place_desc input[value="Save"] {
|
||||||
margin-right: -8px;
|
margin-right: -8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.CardOnGraph .link {
|
||||||
|
position:absolute;
|
||||||
|
width:170px;
|
||||||
|
top:293px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CardOnGraph .best_in_place_link {
|
||||||
|
width: 135px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-top:2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CardOnGraph .best_in_place_link input {
|
||||||
|
width:130px;
|
||||||
|
margin-top:-2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CardOnGraph .go-link {
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
|
|
@ -75,16 +75,7 @@ line-height: 24px;}
|
||||||
.topic .desc { font-size:15px; font-family:Arial, Helvetica, sans-serif; }
|
.topic .desc { font-size:15px; font-family:Arial, Helvetica, sans-serif; }
|
||||||
.topic .desc h3 { font-style:normal; margin-top:5px; }
|
.topic .desc h3 { font-style:normal; margin-top:5px; }
|
||||||
|
|
||||||
.topic .link { position:absolute; width:170px; top:295px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
.topic .link { position:absolute; width:140px; top:295px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||||
|
|
||||||
.best_in_place_name {
|
|
||||||
max-width:130px;
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.best_in_place_name input{
|
|
||||||
max-width:130px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.topic-go-arrow {
|
.topic-go-arrow {
|
||||||
width: 25px;
|
width: 25px;
|
||||||
|
|
|
@ -3,7 +3,7 @@ class TopicsController < ApplicationController
|
||||||
|
|
||||||
respond_to :html, :js, :json
|
respond_to :html, :js, :json
|
||||||
|
|
||||||
autocomplete :topic, :name, :full => true, :extra_data => [:user_id]
|
autocomplete :topic, :name, :full => true, :extra_data => [:user_id], :display_value => :topic_autocomplete_method
|
||||||
|
|
||||||
|
|
||||||
# GET topics
|
# GET topics
|
||||||
|
|
|
@ -22,6 +22,10 @@ has_many :maps, :through => :mappings
|
||||||
|
|
||||||
belongs_to :metacode
|
belongs_to :metacode
|
||||||
|
|
||||||
|
def topic_autocomplete_method
|
||||||
|
"Get: #{self.name}"
|
||||||
|
end
|
||||||
|
|
||||||
# has no viewable synapses helper function
|
# has no viewable synapses helper function
|
||||||
def has_viewable_synapses(current)
|
def has_viewable_synapses(current)
|
||||||
result = false
|
result = false
|
||||||
|
|
Loading…
Add table
Reference in a new issue