Skip to content

Commit

Permalink
Fixed so Env.desktop is properly set and increased the UI resize dela…
Browse files Browse the repository at this point in the history
…y for non desktops
  • Loading branch information
spocke committed Dec 3, 2015
1 parent 610a69b commit 1ba7c80
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions js/tinymce/classes/Env.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
*/
define("tinymce/Env", [], function() {
var nav = navigator, userAgent = nav.userAgent;
var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi;
var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi, phone, tablet;

function matchMediaQuery(query) {
return "matchMedia" in window ? matchMedia(query).matches : false;
}

opera = window.opera && window.opera.buildNumber;
android = /Android/.test(userAgent);
Expand All @@ -33,6 +37,15 @@ define("tinymce/Env", [], function() {
iDevice = /(iPad|iPhone)/.test(userAgent);
fileApi = "FormData" in window && "FileReader" in window && "URL" in window && !!URL.createObjectURL;

webkit = /WebKit/.test(userAgent);
ie = !webkit && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
mac = userAgent.indexOf('Mac') != -1;
android = /Android/.test(userAgent);
iDevice = /(iPad|iPhone)/.test(userAgent);
phone = matchMediaQuery("only screen and (max-device-width: 480px)") && (android || iDevice);
tablet = matchMediaQuery("only screen and (min-width: 800px)") && (android || iDevice);

if (ie12) {
webkit = false;
}
Expand Down Expand Up @@ -162,6 +175,8 @@ define("tinymce/Env", [], function() {
* @property ceFalse
* @type Boolean
*/
ceFalse: (ie === false || ie > 8)
ceFalse: (ie === false || ie > 8),

desktop: !phone && !tablet
};
});
2 changes: 1 addition & 1 deletion js/tinymce/classes/ui/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ define("tinymce/ui/Window", [

$(window).trigger('resize');
}
});
}, 100);

function reposition() {
var i, rect = DomUtils.getWindowSize(), layoutRect;
Expand Down

0 comments on commit 1ba7c80

Please sign in to comment.