FIX: Quote selection in IE11
This commit is contained in:
parent
70fdc10365
commit
27ed60bad0
|
@ -60,7 +60,7 @@ export default Ember.Component.extend({
|
|||
// on Desktop, shows the button at the beginning of the selection
|
||||
// on Mobile, shows the button at the end of the selection
|
||||
const isMobileDevice = this.site.isMobileDevice;
|
||||
const { isIOS, isAndroid, isSafari, isOpera } = this.capabilities;
|
||||
const { isIOS, isAndroid, isSafari, isOpera, isIE11 } = this.capabilities;
|
||||
const showAtEnd = isMobileDevice || isIOS || isAndroid || isOpera;
|
||||
|
||||
// Don't mess with the original range as it results in weird behaviours
|
||||
|
@ -88,7 +88,10 @@ export default Ember.Component.extend({
|
|||
const parent = markerElement.parentNode;
|
||||
parent.removeChild(markerElement);
|
||||
// merge back all text nodes so they don't get messed up
|
||||
parent.normalize();
|
||||
if (!isIE11) {
|
||||
// Skip this fix in IE11 - .normalize causes the selection to change
|
||||
parent.normalize();
|
||||
}
|
||||
|
||||
// work around Safari that would sometimes lose the selection
|
||||
if (isSafari) {
|
||||
|
|
|
@ -30,6 +30,7 @@ export default {
|
|||
return p.toString() === "[object SafariRemoteNotification]";
|
||||
})(!window["safari"] || safari.pushNotification);
|
||||
caps.isChrome = !!window.chrome && !caps.isOpera;
|
||||
caps.isIE11 = !!ua.match(/Trident.*rv\:11\./);
|
||||
|
||||
caps.canPasteImages = caps.isChrome || caps.isFirefox;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue