border-bottom: 1px solid #5A99BA;
padding: 8px 8px 6px 8px;
background-color: #FFF;
- /*float: left;*/
+ /*
+ float: left;
width: 100%;
+ */
}
#delete span {
str = ((seconds % 24 < 10) ? '0' : '') + (seconds % 24) + str;
seconds = parseInt(seconds / 24, 10);
return str;
+ },
+
+ /**
+ * Returns scroll position of the given scroll view.
+ * @param {object} element ScrollView element
+ * @returns {number} scroll position
+ */
+ getScrollPosition: function Helpers_getScrollPosition(element) {
+ return element.scrollview('getScrollPosition').y;
+ },
+
+ /**
+ * Scrolls given jQuery ScrollView to given Y position.
+ * @param {object} element ScrollView element to be scrolled.
+ * @param {number} position Y position to scroll to
+ */
+ scrollTo: function Helpers_scrollTo(element, position) {
+ // don't allow scrolling too much
+ var maxPosition = element.children().first().outerHeight(true) - element.height();
+ if (maxPosition < 0) {
+ maxPosition = 0;
+ }
+ if (position > maxPosition) {
+ position = maxPosition;
+ }
+ if (position < 0) {
+ position = 0;
+ }
+ // scroll
+ element.scrollview('scrollTo', 0, -position);
}
+
};
}());
filterResult,
groupsOfDays = [],
dayLog,
- index = 0;
+ index = 0,
+ calllogList = $('#calllogList'),
+ calllogListContent = $('#calllogListContent'),
+ calllogListContentPos;
function filterForSameEntry(element) {
return self.getNumber(current) === self.getNumber(element)
elements.push(this.getCallItemRow(dayLog.entries[j], dayLog.counters[j]));
}
}
- $('#calllogList')
- .empty()
- .append(elements);
+ calllogListContentPos = this.helpers.getScrollPosition(calllogListContent);
+ calllogList.empty().append(elements);
/* workaround solution for not auto refreshing list view*/
setTimeout(function () {
// original code, do not remove until web-ui release; N_SE-48946
- $( "#calllogList" ).listview({
+ calllogList.listview({
autodividers: true,
//filter: true,
autodividersSelector: function ( li ) {
.removeClass('hidden');
$('#forCallerList .toRemove').show()
}
+
+ setTimeout(this.helpers.scrollTo.bind(this, calllogListContent, calllogListContentPos), 10);
},
/**
<div data-role="header" id="page-header" data-position="fixed">
<h1>Call log</h1>
</div>
- <div data-role="content">
+ <div data-role="content" id="calllogListContent">
<ul data-role="listview"
id="calllogList"
data-filter="true"