Skip to content
Snippets Groups Projects
Commit 4cdddd82 authored by kidkinster's avatar kidkinster
Browse files

Restored * 1 to integerify the offset

-	modified:   src/uncategorized/slaveSummary.tw
parent 8e37c080
No related branches found
No related tags found
2 merge requests!2047RA rework,!1997inducedncs-QL-br-improve
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<<for !_.isUndefined(_ssii = _indexSlavesIdxs.shift())>> <<for !_.isUndefined(_ssii = _indexSlavesIdxs.shift())>>
<<set _IndexSlave = $slaves[_ssii]>> <<set _IndexSlave = $slaves[_ssii]>>
<<if $surnameOrder != 1>> <<if $surnameOrder != 1>>
<<if ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(_Slave.nationality)>> <<if ["Cambodian", "Chinese", "Hungarian", "Japanese", "Korean", "Mongolian", "Taiwanese", "Vietnamese"].includes(_IndexSlave.nationality)>>
<<set _indexSlaveName = [_IndexSlave.slaveSurname || "", _IndexSlave.slaveName].join(" ").trim()>> <<set _indexSlaveName = [_IndexSlave.slaveSurname || "", _IndexSlave.slaveName].join(" ").trim()>>
<<else>> <<else>>
<<set _indexSlaveName = [_IndexSlave.slaveName, _IndexSlave.slaveSurname || ""].join(" ").trim()>> <<set _indexSlaveName = [_IndexSlave.slaveName, _IndexSlave.slaveSurname || ""].join(" ").trim()>>
...@@ -150,16 +150,23 @@ ...@@ -150,16 +150,23 @@
/* /*
* Use javascript scrollTop animation for in page navigation. * Use javascript scrollTop animation for in page navigation.
*/ */
$("[data-quick-index]").click(function() { $("[data-quick-index]").click(function () {
var $quick = $('div#list_index'); var $quick = $('div#list_index');
$quick.toggleClass("hidden"); $quick.toggleClass("hidden");
}); });
$("[data-scroll-to]").click(function() { $("[data-scroll-to]").click(function() {
var $this = $(this); var $this = $(this), $toElement = $this.attr('data-scroll-to'),
var $toElement = $this.attr('data-scroll-to'), $offset = $this.attr('data-scroll-offset') || 0, $speed = $this.attr('data-scroll-speed') || 900, moveto = $($toElement).offset().top; $focusElement = $this.attr('data-scroll-focus'),
$('html, body').animate( { /*
scrollTop: (moveto + $offset) + 'px' * note the *1 enforces $offset to be an integer, without
}, $speed); * it we scroll to True, which goes nowhere fast.
*/
$offset = $this.attr('data-scroll-offset') * 1 || 0,
$speed = $this.attr('data-scroll-speed') * 1 || 500;
$('html, body').animate({
scrollTop: $($toElement).offset().top + $offset
}, $speed);
}); });
</script> </script>
<</if>> <</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment