Skip to content

Commit d8cac5a

Browse files
committed
Fixed 2 bugs:
- Fixed profile widget not property displaying for too long nicks. - Fixed touch triggering hover event on touch devices, but not hiding popovers.
1 parent 81824b8 commit d8cac5a

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ input[type="file"].fileuploadbox {
850850
display: block;
851851
overflow-x: hidden;
852852
white-space: nowrap;
853+
max-width: 170px;
853854
}
854855

855856
.user-profile-idAndNick {

js/bbs/bbs_UI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function UI_register_func() {
8787

8888
// If user clicks on anything outside this anchor or its popover,
8989
// dismiss the popover.
90-
$(document).on('click', UI_closeUnfocusedPopover);
90+
$(document).on('click touchend', UI_closeUnfocusedPopover);
9191

9292
UI_register_func_navigation();
9393
UI_register_func_post_modal();

js/bbs/bbs_global.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// Indicating if the loading logo is now displaying
44
var bbs_loading_show = false;
55

6+
// Indicating whether the app is running on a touch device.
7+
var isTouchDevice = function() {
8+
return ('ontouchstart' in document.documentElement);
9+
};
10+
611
// The info and data of current post to be published
712
var bbs_post_info = {
813
can_anony : false,

js/bbs/bbs_widgets.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@ Widgets.postEntry = function (entry, is_sticky) {
143143
}
144144
var postType = is_sticky ? bbs_type.post_list_mode.sticky
145145
: bbs_type.post_list_mode.normal;
146-
entryNode.mouseenter(function(event) {
147-
miniBar.show();
148-
});
149-
entryNode.mouseleave(function(event) {
150-
miniBar.hide();
151-
});
146+
if (!isTouchDevice()) {
147+
entryNode.mouseenter(function(event) {
148+
miniBar.show();
149+
});
150+
entryNode.mouseleave(function(event) {
151+
miniBar.hide();
152+
});
153+
}
152154
entryNode.click(function() {
153155
UI_set_loading();
154156
view_post(entry.id, postType, UI_update, 'click');
@@ -318,7 +320,8 @@ Widgets.userProfile = function(profile) {
318320
var idPanel = $('<div>').addClass('user-profile-id-panel')
319321
.append($('<span>').addClass('user-profile-id').append(userId));
320322
var nickPanel = $('<div>').addClass('user-profile-nickPanel')
321-
.append($('<span>').addClass('user-profile-nick').append(profile.nick));
323+
.append($('<span>').addClass('user-profile-nick').append(profile.nick)
324+
.attr('title', profile.nick));
322325
var idAndNickPanel = $('<div>').addClass('user-profile-idAndNick')
323326
.append(idPanel).append(nickPanel);
324327

0 commit comments

Comments
 (0)