sped up scroll bars
This commit is contained in:
parent
b7703e2a0f
commit
bfa25bc604
6 changed files with 38 additions and 19 deletions
|
@ -45,7 +45,7 @@ function buildCardWithHogan(node) {
|
||||||
nodeValues.synapse_count = node.getData("synapseCount");
|
nodeValues.synapse_count = node.getData("synapseCount");
|
||||||
nodeValues.id = node.id;
|
nodeValues.id = node.id;
|
||||||
nodeValues.metacode = node.getData("metacode");
|
nodeValues.metacode = node.getData("metacode");
|
||||||
nodeValues.metacode_class = 'mbg' + node.getData("metacode").replace(/\s/g,'');
|
nodeValues.metacode_class = 'mbg' + node.getData("metacode").replace(/\s/g, '');
|
||||||
nodeValues.imgsrc = imgArray[node.getData("metacode")].src;
|
nodeValues.imgsrc = imgArray[node.getData("metacode")].src;
|
||||||
nodeValues.name = node.name;
|
nodeValues.name = node.name;
|
||||||
nodeValues.userid = node.getData("userid");
|
nodeValues.userid = node.getData("userid");
|
||||||
|
@ -127,7 +127,12 @@ function populateShowCard(node) {
|
||||||
$('.metacodeSelect').show();
|
$('.metacodeSelect').show();
|
||||||
// add the scroll bar to the list of metacode select options if it isn't already there
|
// add the scroll bar to the list of metacode select options if it isn't already there
|
||||||
if (!$('.metacodeSelect ul').hasClass('mCustomScrollbar')) {
|
if (!$('.metacodeSelect ul').hasClass('mCustomScrollbar')) {
|
||||||
$('.metacodeSelect ul').mCustomScrollbar();
|
$('.metacodeSelect ul').mCustomScrollbar({
|
||||||
|
mouseWheelPixels: 200,
|
||||||
|
advanced: {
|
||||||
|
updateOnContentResize: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('.metacodeSelect li').click(function () {
|
$('.metacodeSelect li').click(function () {
|
||||||
selectingMetacode = false;
|
selectingMetacode = false;
|
||||||
|
|
|
@ -148,7 +148,7 @@ function updateMetacode(node, metacode) {
|
||||||
data: mdata,
|
data: mdata,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('.CardOnGraph').find('.metacodeTitle').text(metacode)
|
$('.CardOnGraph').find('.metacodeTitle').text(metacode)
|
||||||
.attr('class', 'metacodeTitle mbg' + metacode.replace(/\s/g,''));
|
.attr('class', 'metacodeTitle mbg' + metacode.replace(/\s/g, ''));
|
||||||
$('.CardOnGraph').find('.metacodeImage').css('background-image', 'url(' + imgArray[metacode].src + ')');
|
$('.CardOnGraph').find('.metacodeImage').css('background-image', 'url(' + imgArray[metacode].src + ')');
|
||||||
node.setData("metacode", metacode);
|
node.setData("metacode", metacode);
|
||||||
Mconsole.plot();
|
Mconsole.plot();
|
||||||
|
@ -231,16 +231,16 @@ function updateMapPermission(mapid, permission) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateMetacodeSet(set, index, custom) {
|
function updateMetacodeSet(set, index, custom) {
|
||||||
|
|
||||||
if (custom && MetamapsModel.newSelectedMetacodes.length == 0) {
|
if (custom && MetamapsModel.newSelectedMetacodes.length == 0) {
|
||||||
alert('Please select at least one metacode to use!');
|
alert('Please select at least one metacode to use!');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var codesToSwitchTo;
|
var codesToSwitchTo;
|
||||||
MetamapsModel.selectedMetacodeSetIndex = index;
|
MetamapsModel.selectedMetacodeSetIndex = index;
|
||||||
MetamapsModel.selectedMetacodeSet = "metacodeset-" + set;
|
MetamapsModel.selectedMetacodeSet = "metacodeset-" + set;
|
||||||
|
|
||||||
if (!custom) {
|
if (!custom) {
|
||||||
codesToSwitchTo = $('#metacodeSwitchTabs' + set).attr('data-metacodes').split(',');
|
codesToSwitchTo = $('#metacodeSwitchTabs' + set).attr('data-metacodes').split(',');
|
||||||
$('.customMetacodeList li').addClass('toggledOff');
|
$('.customMetacodeList li').addClass('toggledOff');
|
||||||
|
@ -259,7 +259,7 @@ function updateMetacodeSet(set, index, custom) {
|
||||||
// sort by name
|
// sort by name
|
||||||
codesToSwitchTo.sort();
|
codesToSwitchTo.sort();
|
||||||
codesToSwitchTo.reverse();
|
codesToSwitchTo.reverse();
|
||||||
|
|
||||||
$('#metacodeImg, #metacodeImgTitle').empty();
|
$('#metacodeImg, #metacodeImgTitle').empty();
|
||||||
$('#metacodeImg').removeData('cloudcarousel');
|
$('#metacodeImg').removeData('cloudcarousel');
|
||||||
var newMetacodes = "";
|
var newMetacodes = "";
|
||||||
|
@ -275,7 +275,7 @@ function updateMetacodeSet(set, index, custom) {
|
||||||
mouseWheel: true,
|
mouseWheel: true,
|
||||||
bringToFront: true
|
bringToFront: true
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#lightbox_overlay').hide();
|
$('#lightbox_overlay').hide();
|
||||||
$('#topic_name').focus();
|
$('#topic_name').focus();
|
||||||
|
|
||||||
|
@ -305,8 +305,7 @@ function cancelMetacodeSetSwitch() {
|
||||||
MetamapsModel.selectedMetacodeNames = [];
|
MetamapsModel.selectedMetacodeNames = [];
|
||||||
MetamapsModel.newSelectedMetacodes = [];
|
MetamapsModel.newSelectedMetacodes = [];
|
||||||
MetamapsModel.newSelectedMetacodeNames = [];
|
MetamapsModel.newSelectedMetacodeNames = [];
|
||||||
}
|
} else { // custom set is selected
|
||||||
else { // custom set is selected
|
|
||||||
// reset it to the current actual selection
|
// reset it to the current actual selection
|
||||||
$('.customMetacodeList li').addClass('toggledOff');
|
$('.customMetacodeList li').addClass('toggledOff');
|
||||||
for (var i = 0; i < MetamapsModel.selectedMetacodes.length; i++) {
|
for (var i = 0; i < MetamapsModel.selectedMetacodes.length; i++) {
|
||||||
|
@ -337,7 +336,12 @@ function openNodeShowcard(node) {
|
||||||
|
|
||||||
$('.showcard').fadeIn('fast');
|
$('.showcard').fadeIn('fast');
|
||||||
var s = $('.showcard').find('.scroll');
|
var s = $('.showcard').find('.scroll');
|
||||||
s.height(s.height()).mCustomScrollbar();
|
s.height(s.height()).mCustomScrollbar({
|
||||||
|
mouseWheelPixels: 200,
|
||||||
|
advanced: {
|
||||||
|
updateOnContentResize: true
|
||||||
|
}
|
||||||
|
});
|
||||||
MetamapsModel.showcardInUse = node.id;
|
MetamapsModel.showcardInUse = node.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,9 +351,14 @@ function openLightbox(which) {
|
||||||
|
|
||||||
$('#lightbox_overlay').show();
|
$('#lightbox_overlay').show();
|
||||||
$('#lightbox_main').css('margin-top', '-' + ($('#lightbox_main').height() / 2) + 'px');
|
$('#lightbox_main').css('margin-top', '-' + ($('#lightbox_main').height() / 2) + 'px');
|
||||||
|
|
||||||
if (!MetamapsModel.metacodeScrollerInit) {
|
if (!MetamapsModel.metacodeScrollerInit) {
|
||||||
$('.customMetacodeList, .metacodeSetList').mCustomScrollbar({advanced: { updateOnContentResize: true }});
|
$('.customMetacodeList, .metacodeSetList').mCustomScrollbar({
|
||||||
|
mouseWheelPixels: 200,
|
||||||
|
advanced: {
|
||||||
|
updateOnContentResize: true
|
||||||
|
}
|
||||||
|
});
|
||||||
MetamapsModel.metacodeScrollerInit = true;
|
MetamapsModel.metacodeScrollerInit = true;
|
||||||
}
|
}
|
||||||
if (which == "switchMetacodes") {
|
if (which == "switchMetacodes") {
|
||||||
|
@ -383,5 +392,4 @@ function cancelMapCreate(id) {
|
||||||
form.find('.mapCommonsIcon').addClass('selected');
|
form.find('.mapCommonsIcon').addClass('selected');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ $(document).ready(function () {
|
||||||
|
|
||||||
// initialize scroll bar for filter by metacode, then hide it and position it correctly again
|
// initialize scroll bar for filter by metacode, then hide it and position it correctly again
|
||||||
$("#filter_by_metacode").mCustomScrollbar({
|
$("#filter_by_metacode").mCustomScrollbar({
|
||||||
|
mouseWheelPixels: 200,
|
||||||
advanced: {
|
advanced: {
|
||||||
updateOnContentResize: true
|
updateOnContentResize: true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1764,7 +1764,7 @@ div.mapInfoStat {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
width: 93px;
|
width: 92px;
|
||||||
height: 70px;
|
height: 70px;
|
||||||
float: left;
|
float: left;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
@ -60,7 +60,12 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.FAQ').height( (parseInt($('body').height()) - 40) ).mCustomScrollbar();
|
$('.FAQ').height( (parseInt($('body').height()) - 40) ).mCustomScrollbar({
|
||||||
|
mouseWheelPixels: 200,
|
||||||
|
advanced: {
|
||||||
|
updateOnContentResize: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('.FAQ .question').click(function() {
|
$('.FAQ .question').click(function() {
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<div class="mapCard">
|
<div class="mapCard">
|
||||||
<div class="mapPerm <%= map.mk_permission %>"></div>
|
<div class="mapPerm <%= map.mk_permission %>"></div>
|
||||||
<span class="title">
|
<span class="title">
|
||||||
<%= best_in_place map, :name, :type => :input, :classes => 'best_in_place_name' %>
|
<%= map.name %>
|
||||||
</span>
|
</span>
|
||||||
<div class="mapContains">
|
<div class="mapContains">
|
||||||
<span class="topicCount"><%= pluralize(map.topics.count, 'topic') %></span>
|
<span class="topicCount"><%= pluralize(map.topics.count, 'topic') %></span>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<div class="littleOverlay">
|
<div class="littleOverlay">
|
||||||
<div class="scroll">
|
<div class="scroll">
|
||||||
<div class="desc">
|
<div class="desc">
|
||||||
<%= best_in_place map, :desc, :type => :textarea, :nil => "<span class='gray'>Click to add description.</span>", :classes => 'best_in_place_desc' %>
|
<%= map.desc %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span><%= pluralize(map.contributors.count, 'contributor') %></span><span>Last edit <%= time_ago_in_words( map.updated_at ) %> ago</span>
|
<span><%= pluralize(map.contributors.count, 'contributor') %></span><span>Last edit <%= time_ago_in_words( map.updated_at ) %> ago</span>
|
||||||
|
|
Loading…
Reference in a new issue