fixed synapse creation. replaced homepage bg image

This commit is contained in:
Connor Turland 2014-11-27 21:32:04 -05:00
parent 0e3393e1b5
commit da6a7aadfb
5 changed files with 55 additions and 23 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View file

@ -215,7 +215,7 @@
if (href.attr === "") Metamaps.Router.home(); if (href.attr === "") Metamaps.Router.home();
else { else {
console.log(segments); console.log(segments);
Metamaps.Router[segments[0]](segments[1]); Metamaps.Router[segments[0]](segments[1], segments[2]);
} }
} }
}; };

View file

@ -749,6 +749,10 @@ Metamaps.Create = {
if (datum.id) { // if they clicked on an existing synapse get it if (datum.id) { // if they clicked on an existing synapse get it
Metamaps.Synapse.getSynapseFromAutocomplete(datum.id); Metamaps.Synapse.getSynapseFromAutocomplete(datum.id);
} }
else {
Metamaps.Create.newSynapse.description = datum.value;
Metamaps.Synapse.createSynapseLocally();
}
}); });
}, },
beingCreated: false, beingCreated: false,
@ -3469,13 +3473,44 @@ Metamaps.Filter = {
else console.log(topic); else console.log(topic);
} }
}); });
// flag all the edges back to 'untouched'
Metamaps.Synapses.each(function(synapse) { Metamaps.Synapses.each(function(synapse) {
var e = synapse.get('edge'); var e = synapse.get('edge');
var desc = synapse.get("desc"); e.setData('touched', false);
});
Metamaps.Synapses.each(function(synapse) {
var e = synapse.get('edge');
var desc;
var user_id = synapse.get("user_id").toString(); var user_id = synapse.get("user_id").toString();
if (visible.synapses.indexOf(desc) == -1) passesSynapse = false; if (e && !e.getData('touched')) {
else passesSynapse = true;
var synapses = e.getData('synapses');
// if any of the synapses represent by the edge are still unfiltered
// leave the edge visible
passesSynapse = false;
for (var i = 0; i < synapses.length; i++) {
desc = synapses[i].get("desc");
if (visible.synapses.indexOf(desc) > -1) passesSynapse = true;
}
// if the synapse description being displayed is now being
// filtered, set the displayIndex to the first unfiltered synapse if there is one
var displayIndex = e.getData("displayIndex") ? e.getData("displayIndex") : 0;
var displayedSynapse = synapses[displayIndex];
desc = displayedSynapse.get("desc");
if (passesSynapse && visible.synapses.indexOf(desc) == -1) {
// iterate and find an unfiltered one
for (var i = 0; i < synapses.length; i++) {
desc = synapses[i].get("desc");
if (visible.synapses.indexOf(desc) > -1) {
e.setData('displayIndex', i);
break;
}
}
}
if (onMap) { if (onMap) {
// when on a map, // when on a map,
@ -3488,19 +3523,17 @@ Metamaps.Filter = {
var color = Metamaps.Settings.colors.synapses.normal; var color = Metamaps.Settings.colors.synapses.normal;
if (passesSynapse && passesMapper) { if (passesSynapse && passesMapper) {
if (e) {
e.setData('alpha', 1, 'end'); e.setData('alpha', 1, 'end');
e.setData('color', color, 'end'); e.setData('color', color, 'end');
} }
else console.log(synapse);
}
else { else {
if (e) {
Metamaps.Control.deselectEdge(e, true); Metamaps.Control.deselectEdge(e, true);
e.setData('alpha', opacityForFilter, 'end'); e.setData('alpha', opacityForFilter, 'end');
} }
else console.log(synapse);
e.setData('touched', true);
} }
else if (!e) console.log(synapse);
}); });
// run the animation // run the animation
@ -4538,7 +4571,6 @@ Metamaps.Map = {
encoded_image: canvas.canvas.toDataURL() encoded_image: canvas.canvas.toDataURL()
}; };
console.log(imageData.encoded_image);
var map = Metamaps.Active.Map; var map = Metamaps.Active.Map;
var today = new Date(); var today = new Date();

View file

@ -802,10 +802,10 @@
} }
.fullWidthWrapper.withPartners { .fullWidthWrapper.withPartners {
background: url(homepage_bg.png) no-repeat center -300px; background: url(homepage_bg_fade.png) no-repeat center -300px;
} }
.homeWrapper.homePartners { .homeWrapper.homePartners {
padding: 64px 0 100px; padding: 64px 0 280px;
height: 96px; height: 96px;
background: url(partner_logos.png) no-repeat 0 64px; background: url(partner_logos.png) no-repeat 0 64px;
} }