disabled awkward panning and zooming bugs by editing jit code

This commit is contained in:
Connor Turland 2013-01-05 16:21:11 -05:00
parent 8260fdf7e0
commit e5076533c0
8 changed files with 450 additions and 424 deletions

View file

@ -57,7 +57,7 @@ function graphSettings(type) {
},
//Update node positions when dragged
onDragMove: function (node, eventInfo, e) {
clickDragOnTopic(node, eventInfo, e);
clickDragOnTopic(node, eventInfo, e);
},
onDragEnd: function() {
if (tempInit && tempNode2 == null) {
@ -196,7 +196,7 @@ function graphSettings(type) {
},
//Update node positions when dragged
onDragMove: function (node, eventInfo, e) {
clickDragOnTopic(node, eventInfo, e);
clickDragOnTopic(node, eventInfo, e);
},
onDragEnd: function() {
if (tempInit && tempNode2 == null) {
@ -557,7 +557,6 @@ function onCreateLabelHandler(domElement, node) {
height="50" \
width="50" \
src="$_imgsrc_$" /> \
<div class="scroll"> \
<span class="title"> \
<span class="best_in_place best_in_place_name" \
data-url="/topics/$_id_$" \
@ -575,6 +574,7 @@ function onCreateLabelHandler(domElement, node) {
Added by: <a href="/users/$_userid_$" target="_blank">$_username_$ \
</a> \
</div> \
<div class="scroll"> \
<div class="desc"> \
<span class="best_in_place best_in_place_desc" \
data-url="/topics/$_id_$" \
@ -593,6 +593,7 @@ function onCreateLabelHandler(domElement, node) {
data-object="topic" \
data-attribute="link" \
data-type="input">$_link_$</span>$_close_a_tag_$ \
<div class="clearfloat"></div> \
</div>';
//link is rendered differently if user is logged out or in

View file

@ -2585,6 +2585,9 @@ Extras.Classes.Navigation = new Class({
onMouseWheel: function(e, win, scroll) {
if(!this.config.zooming) return;
// START METAMAPS CODE
if (e.target.id != 'infovis-canvas') return;
// END METAMAPS CODE
$.event.stop($.event.get(e, win));
var val = this.config.zooming / 1000,
ans = 1 + scroll * val;
@ -2611,6 +2614,12 @@ Extras.Classes.Navigation = new Class({
if(!this.config.panning) return;
if(!this.pressed) 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,
currentPos = eventInfo.getPos(),
canvas = this.canvas,

View file

@ -33,6 +33,7 @@ var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null,
$('#topic_name').bind('railsAutocomplete.select', function(event, data){
if (data.item.id != undefined) {
$('#topic_grabTopic').val(data.item.id);
$('.new_topic').submit();
}
});

View file

@ -127,27 +127,19 @@
return false;
});
// Add code that makes up and down arrows scroll through.
$('.new_topic').bind('keydown keypress',this,function(event) {
//console.log(event)
if (event.keyCode == 38 || event.keyCode == 40)
{
//e.preventDefault();
// Add code that makes tab and shift+tab scroll through metacodes
$('.new_topic').bind('keydown',this,function(event){
if (event.keyCode == 9 || (event.keyCode == 9 && event.shiftKey)) {
event.preventDefault();
}
});
$('.new_topic').bind('keyup',this,function(event){
console.log(event);
//console.log(event);
/*key navigation through elements*/
if (event.keyCode == 38 || event.keyCode == 40) {
switch ( event.keyCode ) {
case 38: // Up
event.data.rotate(-1);
break;
case 40: // Down
event.data.rotate(1);
break;
}
return;
if (event.keyCode == 9 && event.shiftKey) {
event.data.rotate(-1);
} else if (event.keyCode == 9) {
event.data.rotate(1);
}
});

View file

@ -44,7 +44,7 @@
.CardOnGraph .scroll {
display:block;
height:283px;
height:232px;
}
.CardOnGraph .type {
@ -71,6 +71,15 @@
padding-bottom:5px;
}
.CardOnGraph .best_in_place_name {
max-width:130px;
float:left;
}
.CardOnGraph .best_in_place_name input{
max-width:130px;
}
.CardOnGraph .desc {
font-size:15px;
font-family:Arial, Helvetica, sans-serif;
@ -81,28 +90,47 @@
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 {
float: right;
margin: 2px 0px 0px 2px;
padding: 1px 5px;
}
.CardOnGraph .best_in_place_desc {
width:140px;
display:block;
margin-top:2px;
}
.CardOnGraph .best_in_place_desc input[value="Save"] {
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;
}

View file

@ -75,16 +75,7 @@ line-height: 24px;}
.topic .desc { font-size:15px; font-family:Arial, Helvetica, sans-serif; }
.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; }
.best_in_place_name {
max-width:130px;
float:left;
}
.best_in_place_name input{
max-width:130px;
}
.topic .link { position:absolute; width:140px; top:295px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-go-arrow {
width: 25px;

View file

@ -3,7 +3,7 @@ class TopicsController < ApplicationController
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

View file

@ -22,6 +22,10 @@ has_many :maps, :through => :mappings
belongs_to :metacode
def topic_autocomplete_method
"Get: #{self.name}"
end
# has no viewable synapses helper function
def has_viewable_synapses(current)
result = false