New mobile header
Add job pages More news button on home page links to news page Small mobile fixes for new page and other pages
This commit is contained in:
8
public/js/functions.js
vendored
8
public/js/functions.js
vendored
@@ -3,13 +3,13 @@
|
||||
* @param {object} _options
|
||||
*/
|
||||
$.fn.loadMoreNews = function (_options) {
|
||||
var nextPage = 2;
|
||||
var isLoading = false;
|
||||
var page = 1;
|
||||
var options = {
|
||||
loadingElementId: '#loading',
|
||||
container: '',
|
||||
url: document.location.pathname
|
||||
url: document.location.pathname,
|
||||
nextPage: 2
|
||||
};
|
||||
|
||||
$.extend(options, _options);
|
||||
@@ -26,7 +26,7 @@
|
||||
var $container = $(options.container)
|
||||
|
||||
// Fire request for the next page
|
||||
$.ajax({url: options.url + (options.url.indexOf('?') >= 0 ? '&' : '?') + 'pagina=' + nextPage})
|
||||
$.ajax({url: options.url + (options.url.indexOf('?') >= 0 ? '&' : '?') + 'pagina=' + options.nextPage})
|
||||
.always(function () {
|
||||
// Whether success or failure, update the UI again
|
||||
isLoading = 0;
|
||||
@@ -45,7 +45,7 @@
|
||||
var id = this.toString();
|
||||
$(id).append($('<div>'+data+'</div>').find(id).length ? $('<div>'+data+'</div>').find(id).children() : $(data));
|
||||
});
|
||||
++nextPage;
|
||||
++options.nextPage;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user