Feature: Added new News date filter to the news page
This commit is contained in:
8
public/js/functions.js
vendored
8
public/js/functions.js
vendored
@@ -31,14 +31,16 @@ $(document).ready(function(){
|
||||
loadingElementId: '#loading',
|
||||
container: '',
|
||||
url: document.location.pathname,
|
||||
nextPage: 2
|
||||
nextPage: 2,
|
||||
dateStart: null,
|
||||
dateEnd:null
|
||||
};
|
||||
|
||||
$.extend(options, _options);
|
||||
var $isLoading = $(options.loadingElementId, this);
|
||||
$isLoading.hide();
|
||||
|
||||
this.click(function (e) {
|
||||
this.unbind('click').click(function (e) {
|
||||
e.preventDefault();
|
||||
if (!isLoading) {
|
||||
// Set flag and update UI
|
||||
@@ -48,7 +50,7 @@ $(document).ready(function(){
|
||||
var $container = $(options.container)
|
||||
|
||||
// Fire request for the next page
|
||||
$.ajax({url: options.url + (options.url.indexOf('?') >= 0 ? '&' : '?') + 'pagina=' + options.nextPage})
|
||||
$.ajax({url: options.url + (options.url.indexOf('?') >= 0 ? '&' : '?') + 'pagina=' + options.nextPage + (options.dateStart ? '&dateStart=' + options.dateStart : '') + (options.dateEnd ? '&dateEnd=' + options.dateEnd : '')})
|
||||
.always(function () {
|
||||
// Whether success or failure, update the UI again
|
||||
isLoading = 0;
|
||||
|
||||
Reference in New Issue
Block a user