Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit b03ea1f

Browse files
committed
Fixed double-click selection
Also show ticks up to 900px w
1 parent 9f02d08 commit b03ea1f

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

app/js/controllers.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,12 +1402,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
14021402
}
14031403

14041404
if (!$scope.historyState.selectActions) {
1405-
var sel = (
1406-
window.getSelection && window.getSelection() ||
1407-
document.getSelection && document.getSelection() ||
1408-
document.selection && document.selection.createRange().text || ''
1409-
).toString().replace(/^\s+|\s+$/g, '');
1410-
if (sel) {
1405+
if (getSelectedText()) {
14111406
return false;
14121407
}
14131408

app/js/directives.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ angular.module('myApp.directives', ['myApp.filters'])
12171217
updateSizes();
12181218
if (data && data.blur) {
12191219
$scope.$broadcast('ui_message_blur');
1220-
} else {
1220+
} else if (!getSelectedText()) {
12211221
$scope.$broadcast('ui_message_send');
12221222
}
12231223

app/js/lib/utils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,16 @@ function setRichFocus(field, selectNode) {
237237
}
238238
}
239239

240+
function getSelectedText () {
241+
var sel = (
242+
window.getSelection && window.getSelection() ||
243+
document.getSelection && document.getSelection() ||
244+
document.selection && document.selection.createRange().text || ''
245+
).toString().replace(/^\s+|\s+$/g, '');
246+
247+
return sel;
248+
}
249+
240250
function scrollToNode (scrollable, node, scroller) {
241251
var elTop = node.offsetTop - 15,
242252
elHeight = node.offsetHeight + 30,

app/less/desktop.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ a.footer_link.active:active {
903903
display: none;
904904
}
905905

906-
@media (min-width: 1024px) {
906+
@media (min-width: 900px) {
907907
.im_message_wrap {
908908
position: relative;
909909
}

0 commit comments

Comments
 (0)