Browse Source

Fixed double-click selection

Also show ticks up to 900px w
master
Igor Zhukov 10 years ago
parent
commit
b03ea1f1b0
  1. 7
      app/js/controllers.js
  2. 2
      app/js/directives.js
  3. 10
      app/js/lib/utils.js
  4. 2
      app/less/desktop.less

7
app/js/controllers.js

@ -1402,12 +1402,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
if (!$scope.historyState.selectActions) { if (!$scope.historyState.selectActions) {
var sel = ( if (getSelectedText()) {
window.getSelection && window.getSelection() ||
document.getSelection && document.getSelection() ||
document.selection && document.selection.createRange().text || ''
).toString().replace(/^\s+|\s+$/g, '');
if (sel) {
return false; return false;
} }

2
app/js/directives.js

@ -1217,7 +1217,7 @@ angular.module('myApp.directives', ['myApp.filters'])
updateSizes(); updateSizes();
if (data && data.blur) { if (data && data.blur) {
$scope.$broadcast('ui_message_blur'); $scope.$broadcast('ui_message_blur');
} else { } else if (!getSelectedText()) {
$scope.$broadcast('ui_message_send'); $scope.$broadcast('ui_message_send');
} }

10
app/js/lib/utils.js

@ -237,6 +237,16 @@ function setRichFocus(field, selectNode) {
} }
} }
function getSelectedText () {
var sel = (
window.getSelection && window.getSelection() ||
document.getSelection && document.getSelection() ||
document.selection && document.selection.createRange().text || ''
).toString().replace(/^\s+|\s+$/g, '');
return sel;
}
function scrollToNode (scrollable, node, scroller) { function scrollToNode (scrollable, node, scroller) {
var elTop = node.offsetTop - 15, var elTop = node.offsetTop - 15,
elHeight = node.offsetHeight + 30, elHeight = node.offsetHeight + 30,

2
app/less/desktop.less

@ -903,7 +903,7 @@ a.footer_link.active:active {
display: none; display: none;
} }
@media (min-width: 1024px) { @media (min-width: 900px) {
.im_message_wrap { .im_message_wrap {
position: relative; position: relative;
} }

Loading…
Cancel
Save