( event )
| 100 | } |
| 101 | |
| 102 | function checkTextHighlighting( event ) { |
| 103 | |
| 104 | var selection = window.getSelection(); |
| 105 | |
| 106 | |
| 107 | if ( (event.target.className === "url-input" || |
| 108 | event.target.classList.contains( "url" ) || |
| 109 | event.target.parentNode.classList.contains( "ui-inputs" ) ) ) { |
| 110 | |
| 111 | currentNodeList = findNodes( selection.focusNode ); |
| 112 | updateBubbleStates(); |
| 113 | return; |
| 114 | } |
| 115 | |
| 116 | // Check selections exist |
| 117 | if ( selection.isCollapsed === true && lastType === false ) { |
| 118 | |
| 119 | onSelectorBlur(); |
| 120 | } |
| 121 | |
| 122 | // Text is selected |
| 123 | if ( selection.isCollapsed === false && composing === false ) { |
| 124 | |
| 125 | currentNodeList = findNodes( selection.focusNode ); |
| 126 | |
| 127 | // Find if highlighting is in the editable area |
| 128 | if ( hasNode( currentNodeList, "ARTICLE") ) { |
| 129 | updateBubbleStates(); |
| 130 | updateBubblePosition(); |
| 131 | |
| 132 | // Show the ui bubble |
| 133 | textOptions.className = "text-options active"; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | lastType = selection.isCollapsed; |
| 138 | } |
| 139 | |
| 140 | function updateBubblePosition() { |
| 141 | var selection = window.getSelection(); |
no test coverage detected