* @param {function} onSuccess Callback
*/
getCallHistoryForCaller: function Model_getCallHistoryForCaller(phoneNumber, onSuccess) {
- tizen.callhistory.find(onSuccess, null, // error is ignored
- new tizen.AttributeFilter('remoteParties.remoteParty', 'EXACTLY', phoneNumber),
- new tizen.SortMode('startTime', 'DESC')
- );
+ var filter = null, success;
+ if (phoneNumber) {
+ filter = new tizen.AttributeFilter('remoteParties.remoteParty', 'EXACTLY', phoneNumber);
+ success = onSuccess;
+ } else {
+ success = function (calls) {
+ onSuccess(calls.filter(function (element) {
+ if(!element.remoteParties[0].remoteParty) {
+ return element;
+ }
+ }));
+ };
+ }
+
+ tizen.callhistory.find(success,
+ function (e) {
+ console.error(e);
+ },
+ filter,
+ new tizen.SortMode('startTime', 'DESC')
+ );
},
/**
app.showCallHistory();
});
- $(".ui-scrollview-view").listview();
+ //original code, do not remove until web-ui release; N_SE-48946
+ //$(".ui-scrollview-view").listview();
$('#historyForCallerView').on('tap', '.ui-btn-back', function (event) {
event.preventDefault();
.fadeOut(200);
});
- $('.selectAllBox').children().on('tap', function () {
+ $('.selectAllBox').children().on('click', function () {
+ $('.selectAllBox input[type=checkbox]').trigger('click');
self.selectAll();
self.selectAllDetailsEach();
});
});
$('#calllogList').on('click', '.call', function onCalllogEntryClick(event) {
- if ($(this).data('entries')[0].remoteParties[0].remoteParty !== "") {
- app.showHistoryForCaller($(this).data('entries')[0].remoteParties[0].remoteParty);
- $.mobile.changePage('#historyForCallerView');
- }
+ var remoteParty = $(this)
+ .data('entries')[0]
+ .remoteParties[0]
+ .remoteParty;
+ app.showHistoryForCaller(remoteParty);
+ $.mobile.changePage('#historyForCallerView');
});
$('#smsActionBtn').on('tap', function (event) {
} else if ($.mobile.activePage.attr('id') === 'callView') {
tizen.application.getCurrentApplication().exit();
} else {
- $('.ui-listview-filter .ui-input-text').val('');
- $('.ui-listview-filter .ui-input-text').trigger('change');
history.back();
}
}
dayLog = groupsOfDays[i];
tempLength = dayLog.entries.length;
entryShortDate = this.helpers.getShortDate(dayLog.entries[0].startTime);
-
// add date header;
- elements.push($(this.templateManager.get('dateRow', {
- 'date': today === entryShortDate ? 'Today' : dayLog.date
- })).get(0));
+ //original code, do not remove until web-ui release; N_SE-48946
+// elements.push($(this.templateManager.get('dateRow', {
+// 'date': today === entryShortDate ? 'Today' : dayLog.date
+// })).get(0));
for (j = 0; j < tempLength; j = j + 1) {
elements.push(this.getCallItemRow(dayLog.entries[j], dayLog.counters[j]));
}
}
-
$('#calllogList')
.empty()
.append(elements);
/* workaround solution for not auto refreshing list view*/
- setTimeout(function () {
- $(".ui-scrollview-view").listview().listview('refresh');
+ setTimeout(function () {
+ // original code, do not remove until web-ui release; N_SE-48946
+ $( "#calllogList" ).listview({
+ autodividers: true,
+ //filter: true,
+ autodividersSelector: function ( li ) {
+ console.log("autodividersSelector")
+ return $(li).find('.callDate').text() === new Date().toLocaleDateString()
+ ? "Today" : $(li).find('.callDate').text();
+ }
+ }).listview('refresh');
+ $(".ui-li-divider").removeClass().addClass("date");
}, 0);
/* workaround for registering call during working app in removeMode */
tpl = this.templateManager.get('callItemRow', {
'name': name,
'callTime': entry.startTime.toLocaleTimeString(),
+ 'callDate': entry.startTime.toLocaleDateString(),
'cssClasses': this.cssClassesForEntry(entry),
'uid': entry.uid
});
}
}
}
- return name || number || 'Unknown';
+ return name || number;
},
/**
});
}
this.addEventsForCallerListCheckboxes();
+ // lock buttons if unknown caller
+ if(remoteParty) {
+ this.unlockOptionButtons();
+ } else {
+ this.lockButtons();
+ }
},
/**
this.updateCallerHeaderAccountId('');
this.updateCallerHeaderNumberOfEntries(numberOfEntries);
}
- $('.contact > .infoContainer > .name')
- .html($('<span>').text(name).html());
+ $('.contact > .infoContainer > .name').html(name);
},