Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion resources/css/humhub.wiki.css
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,16 @@
margin-bottom: -2px;
}
#category_list_view .drag-icon {
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease;
color: var(--text-color-soft);
}
#category_list_view .drag-icon .fa {
font-size: 11px;
}
#category_list_view .page-title:hover .drag-icon {
#category_list_view .drag-icon.visible {
opacity: 1;
visibility: visible;
cursor: move;
}
Expand Down
9 changes: 5 additions & 4 deletions resources/css/humhub.wiki.less
Original file line number Diff line number Diff line change
Expand Up @@ -789,16 +789,17 @@
}

.drag-icon {
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease;
color: @text-color-control;

.fa {
font-size: 11px;
}
}

.page-title:hover {
.drag-icon {

&.visible {
opacity: 1;
visibility: visible;
cursor: move;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/css/humhub.wiki.min.css

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions resources/js/humhub.wiki.CategoryListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ humhub.module('wiki.CategoryListView', function(module, require, $) {
this.initFoldingSubpages();
this.initSorting();
this.initPageTitleLink();
this.initDragButtonHoverDelay();
}

CategoryListView.prototype.initFoldingSubpages = function() {
Expand Down Expand Up @@ -266,5 +267,28 @@ humhub.module('wiki.CategoryListView', function(module, require, $) {
});
};

CategoryListView.prototype.initDragButtonHoverDelay = function() {
const HOVER_DELAY = 1000;
const dragClass = '.wiki-page-control.drag-icon';

this.$.find('.page-title').each(function () {
const $item = $(this);
const $dragBtn = $item.find(dragClass);

let timer = null;

$item.on('mouseenter', function () {
timer = setTimeout(() => {
$dragBtn.addClass('visible');
}, HOVER_DELAY);
});

$item.on('mouseleave', function () {
clearTimeout(timer);
$dragBtn.removeClass('visible');
});
});
};

module.export = CategoryListView;
});
40 changes: 32 additions & 8 deletions resources/js/humhub.wiki.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ humhub.module('wiki', function(module, require, $) {
unload: unload
})
});

humhub.module('wiki.Page', function (module, require, $) {
var Widget = require('ui.widget').Widget;
var wikiView = require('wiki');
Expand Down Expand Up @@ -305,7 +305,7 @@ humhub.module('wiki.Page', function (module, require, $) {

module.export = Page;
});

humhub.module('wiki.Form', function(module, require, $) {
var Widget = require('ui.widget').Widget;
var wikiView = require('wiki');
Expand Down Expand Up @@ -388,7 +388,7 @@ humhub.module('wiki.Form', function(module, require, $) {

module.export = Form;
});

humhub.module('wiki.CategoryListView', function(module, require, $) {
var Widget = require('ui.widget').Widget;
var client = require('client');
Expand All @@ -410,6 +410,7 @@ humhub.module('wiki.CategoryListView', function(module, require, $) {
this.initFoldingSubpages();
this.initSorting();
this.initPageTitleLink();
this.initDragButtonHoverDelay();
}

CategoryListView.prototype.initFoldingSubpages = function() {
Expand Down Expand Up @@ -657,9 +658,32 @@ humhub.module('wiki.CategoryListView', function(module, require, $) {
});
};

CategoryListView.prototype.initDragButtonHoverDelay = function() {
const HOVER_DELAY = 1000;
const dragClass = '.wiki-page-control.drag-icon';

this.$.find('.page-title').each(function () {
const $item = $(this);
const $dragBtn = $item.find(dragClass);

let timer = null;

$item.on('mouseenter', function () {
timer = setTimeout(() => {
$dragBtn.addClass('visible');
}, HOVER_DELAY);
});

$item.on('mouseleave', function () {
clearTimeout(timer);
$dragBtn.removeClass('visible');
});
});
};

module.export = CategoryListView;
});

humhub.module('wiki.linkExtension', function (module, require, $) {
var richtext = require('ui.richtext.prosemirror');
var Widget = require('ui.widget').Widget;
Expand Down Expand Up @@ -929,7 +953,7 @@ humhub.module('wiki.linkExtension', function (module, require, $) {
setEditorLink: setEditorLink
});
});

humhub.module('wiki.History', function(module, require, $) {
var Widget = require('ui.widget').Widget;
var client = require('client');
Expand Down Expand Up @@ -988,7 +1012,7 @@ humhub.module('wiki.History', function(module, require, $) {
}

module.export = History;
});
});
humhub.module('wiki.Sidebar', function(module, require, $) {
const Widget = require('ui.widget').Widget;

Expand Down Expand Up @@ -1044,7 +1068,7 @@ humhub.module('wiki.Sidebar', function(module, require, $) {
}

module.export = Sidebar;
});
});
humhub.module('wiki.ListTable', function(module, require, $) {
const Widget = require('ui.widget').Widget;

Expand All @@ -1063,7 +1087,7 @@ humhub.module('wiki.ListTable', function(module, require, $) {
};

module.export = ListTable;
});
});
/**
* htmldiff.js a diff algorithm that understands HTML, and produces HTML in the browser.
*
Expand Down
2 changes: 1 addition & 1 deletion resources/js/humhub.wiki.bundle.min.js

Large diffs are not rendered by default.