Skip to content

Commit ec89dbf

Browse files
authored
Merge pull request #293 from apinf/feature/edge-fixes
Fix various bugs on Internet Exploder and Edge
2 parents 124aaae + 48f7720 commit ec89dbf

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

src/app.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export class App {
8080
this.richPreview = new SwaggerUIBundle({
8181
url,
8282
dom_id: '#rich-preview',
83+
// Disable Swagger.io online validation (AKA spyware)
84+
validatorUrl: null,
8385
presets: [
8486
SwaggerUIBundle.presets.apis,
8587
SwaggerUIStandalonePreset
@@ -146,6 +148,20 @@ export class App {
146148
fileInput.appendTo('body');
147149
fileInput.trigger('click');
148150

151+
// IE/Edge don't want to trigger change events, so I have to do it for them...
152+
//
153+
// Check that the browser is IE/Edge
154+
if (!!window.StyleMedia) {
155+
// Check if there is a file every 0.5 seconds
156+
const interval = setInterval(() => {
157+
if (fileInput[0].files[0]) {
158+
// The file was found, so trigger a change event and stop the interval.
159+
fileInput.trigger('change');
160+
clearInterval(interval);
161+
}
162+
}, 500);
163+
}
164+
149165
fileInput.change(() => {
150166
const file = fileInput[0].files[0];
151167
const reader = new FileReader();

src/resources/elements/optionfield.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ export class Optionfield extends Field {
281281
* @private
282282
*/
283283
getViewStrategy() {
284-
// Dropdowns break on IE, so we have a separate HTML file for IE.
285-
if (!!document.documentMode && this.format === 'dropdown') {
284+
// Dropdowns break on IE and Edge, so we have a separate HTML file for them.
285+
if (!!window.StyleMedia && this.format === 'dropdown') {
286286
return `resources/elements/optionfield-${this.format}-ie.html`;
287287
}
288288
return `resources/elements/optionfield-${this.format}.html`;

src/sections/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div class="actions">
3939
<div class="split dropdown">
4040
<button class="button">
41-
<img src="res/split.svg" alt="Delete"/>
41+
<img src="res/split.svg" alt="Split"/>
4242
</button>
4343
<div class="content">
4444
<a href="javascript:void(0)" click.delegate="split('editor')" t="nav.actions.split.editor">

src/style/_dropdown.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
> .content {
2525
position: absolute;
26-
z-index: 1;
26+
z-index: 10;
2727

2828
display: none;
2929

src/style/_nav.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
}
5353

5454
> .actions {
55+
position: relative;
56+
z-index: 9;
57+
5558
float: right;
5659

5760
max-height: 2.5rem;

0 commit comments

Comments
 (0)