mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
closes #197
This commit is contained in:
@@ -94,9 +94,12 @@ var ajaxify = {};
|
||||
|
||||
// Enhancing all anchors to ajaxify...
|
||||
$(document.body).on('click', 'a', function(e) {
|
||||
if (this.href == window.location.href + "#") return;
|
||||
if(this.href.slice(-1) === "#") return;
|
||||
|
||||
function hrefEmpty(href) {
|
||||
return href == 'javascript:;' || href == window.location.href + "#" || href.slice(-1) === "#";
|
||||
}
|
||||
|
||||
if(hrefEmpty(this.href)) return;
|
||||
|
||||
var url = this.href.replace(rootUrl +'/', '');
|
||||
|
||||
|
||||
@@ -218,7 +218,6 @@ var socket,
|
||||
|
||||
app.current_room = null;
|
||||
app.enter_room = function(room) {
|
||||
|
||||
if(socket) {
|
||||
if (app.current_room === room)
|
||||
return;
|
||||
|
||||
@@ -26,17 +26,12 @@
|
||||
if (thread_state.pinned === '1') set_pinned_state(true);
|
||||
|
||||
if (expose_tools === '1') {
|
||||
var deleteThreadEl = document.getElementById('delete_thread'),
|
||||
lockThreadEl = document.getElementById('lock_thread'),
|
||||
pinThreadEl = document.getElementById('pin_thread'),
|
||||
moveThreadEl = document.getElementById('move_thread'),
|
||||
moveThreadModal = $('#move_thread_modal');
|
||||
var moveThreadModal = $('#move_thread_modal');
|
||||
|
||||
adminTools.style.visibility = 'inherit';
|
||||
|
||||
// Add events to the thread tools
|
||||
deleteThreadEl.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('#delete_thread').on('click', function(e) {
|
||||
if (thread_state.deleted !== '1') {
|
||||
bootbox.confirm('Are you sure you want to delete this thread?', function(confirm) {
|
||||
if (confirm) socket.emit('api:topic.delete', { tid: tid });
|
||||
@@ -46,30 +41,31 @@
|
||||
if (confirm) socket.emit('api:topic.restore', { tid: tid });
|
||||
});
|
||||
}
|
||||
}, false);
|
||||
return false;
|
||||
});
|
||||
|
||||
lockThreadEl.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('#lock_thread').on('click', function(e) {
|
||||
if (thread_state.locked !== '1') {
|
||||
socket.emit('api:topic.lock', { tid: tid });
|
||||
} else {
|
||||
socket.emit('api:topic.unlock', { tid: tid });
|
||||
}
|
||||
}, false);
|
||||
return false;
|
||||
});
|
||||
|
||||
pinThreadEl.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('#pin_thread').on('click', function(e) {
|
||||
if (thread_state.pinned !== '1') {
|
||||
socket.emit('api:topic.pin', { tid: tid });
|
||||
} else {
|
||||
socket.emit('api:topic.unpin', { tid: tid });
|
||||
}
|
||||
}, false);
|
||||
return false;
|
||||
});
|
||||
|
||||
moveThreadEl.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('#move_thread').on('click', function(e) {
|
||||
moveThreadModal.modal('show');
|
||||
}, false);
|
||||
return false;
|
||||
});
|
||||
|
||||
moveThreadModal.on('shown', function() {
|
||||
var loadingEl = document.getElementById('categories-loading');
|
||||
|
||||
Reference in New Issue
Block a user