Skip to content

Commit

Permalink
refactor: Remove logic and style that accommodates non-flex fallbacks (
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-bc-dev authored and misteroneill committed Nov 23, 2022
1 parent 672f7ad commit 34cbfde
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 128 deletions.
8 changes: 0 additions & 8 deletions src/css/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@
}

@mixin flex($value) {
// @include context('.video-js', '.video-js.vjs-no-flex') {
// display: table-cell;
// vertical-align: middle;
// @if ($value == 'auto') {
// width: auto;
// }
// }

-webkit-box-flex: $value;
-moz-box-flex: $value;
-webkit-flex: $value;
Expand Down
4 changes: 0 additions & 4 deletions src/css/components/_adaptive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,5 @@
@include flex(auto);
display: block;
}

&.vjs-no-flex .vjs-custom-control-spacer {
width: auto;
}
}
}
5 changes: 0 additions & 5 deletions src/css/components/_control-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,3 @@
visibility: visible;
pointer-events: auto;
}

// no flex support
.vjs-has-started.vjs-no-flex .vjs-control-bar {
display: table;
}
5 changes: 0 additions & 5 deletions src/css/components/_control.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,3 @@
.video-js *:not(.vjs-visible-text) > .vjs-control-text {
@include hide-visually;
}

.vjs-no-flex .vjs-control {
display: table-cell;
vertical-align: middle;
}
12 changes: 0 additions & 12 deletions src/css/components/_live.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
line-height: 3em;
}

.vjs-no-flex .vjs-live-control {
display: table-cell;
width: auto;
text-align: left;
}

// hide the LiveDisplay when not live or when
// the new liveui is in use
.video-js:not(.vjs-live) .vjs-live-control,
Expand All @@ -34,12 +28,6 @@
min-width: 4em;
}

.vjs-no-flex .vjs-seek-to-live-control {
display: table-cell;
width: auto;
text-align: left;
}

// hide the SeekToLive button when not live and
// when the liveui is not in use
.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,
Expand Down
12 changes: 0 additions & 12 deletions src/css/components/_progress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
@include display-flex(center);
}

.vjs-no-flex .vjs-progress-control {
width: auto;
}

// .vjs-progress-holder / SeekBar
//
// Box containing play and load progress bars. It also acts as seek scrubber.
Expand Down Expand Up @@ -154,10 +150,6 @@
z-index: 1;
}

.vjs-no-flex .vjs-progress-control .vjs-mouse-display {
z-index: 0;
}

.video-js .vjs-progress-control:hover .vjs-mouse-display {
display: block;
}
Expand All @@ -169,10 +161,6 @@
@include transition($trans);
}

.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display {
display: none;
}

.vjs-mouse-display .vjs-time-tooltip {
color: #fff;
@include background-color-with-alpha(#000, 0.8);
Expand Down
20 changes: 3 additions & 17 deletions src/css/components/_time.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,14 @@
padding-right: 1em;
}

.vjs-live .vjs-time-control {
display: none;
}

// We need the extra specificity that referencing .vjs-no-flex provides.
.vjs-live .vjs-time-control,
.vjs-live .vjs-time-divider,
.video-js .vjs-current-time,
.vjs-no-flex .vjs-current-time {
display: none;
}

.video-js .vjs-duration,
.vjs-no-flex .vjs-duration {
.video-js .vjs-duration {
display: none;
}

.vjs-time-divider {
display: none;
line-height: 3em;
}

.vjs-live .vjs-time-divider {
// Already the default, but we want to ensure when the player is live
// this hides in the same way as the other time controls for other skins
display: none;
}
26 changes: 0 additions & 26 deletions src/css/components/_volume.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,6 @@
@include transition($transition-property)
}

.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {
width: 5em;
height: 3em;

visibility: visible;
opacity: 1;
position: relative;

@include transition(none);
}

.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,
.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {
position: absolute;
bottom: 3em;
left: 0.5em;
}

.video-js .vjs-volume-panel {
@include display-flex;
}
Expand Down Expand Up @@ -243,10 +225,6 @@
height: 100%;
}

.vjs-no-flex .vjs-volume-control .vjs-mouse-display {
z-index: 0;
}

.video-js .vjs-volume-control:hover .vjs-mouse-display {
display: block;
}
Expand All @@ -258,10 +236,6 @@
@include transition($trans);
}

.video-js.vjs-user-inactive.vjs-no-flex .vjs-volume-control .vjs-mouse-display {
display: none;
}

.vjs-mouse-display .vjs-volume-tooltip {
color: #fff;
@include background-color-with-alpha(#000, 0.8);
Expand Down
16 changes: 1 addition & 15 deletions src/css/components/menu/_menu-inline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
// Hover state
.video-js .vjs-menu-button-inline:hover,
.video-js .vjs-menu-button-inline:focus,
.video-js .vjs-menu-button-inline.vjs-slider-active,
.video-js.vjs-no-flex .vjs-menu-button-inline {
.video-js .vjs-menu-button-inline.vjs-slider-active {
// This width is currently specific to the inline volume bar.
width: 12em;
}
Expand All @@ -41,19 +40,6 @@
opacity: 1;
}

.vjs-no-flex .vjs-menu-button-inline .vjs-menu {
display: block;
opacity: 1;
position: relative;
width: auto;
}

.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu,
.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,
.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu {
width: auto;
}

.vjs-menu-button-inline .vjs-menu-content {
width: auto;
height: 100%;
Expand Down
24 changes: 0 additions & 24 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,6 @@ class Player extends Component {
this.addClass('vjs-audio');
}

if (this.flexNotSupported_()) {
this.addClass('vjs-no-flex');
}

// TODO: Make this smarter. Toggle user state between touching/mousing
// using events, since devices can have both touch and mouse events.
// TODO: Make this check be performed again when the window switches between monitors
Expand Down Expand Up @@ -4968,26 +4964,6 @@ class Player extends Component {
return baseOptions;
}

/**
* Determine whether or not flexbox is supported
*
* @return {boolean}
* - true if flexbox is supported
* - false if flexbox is not supported
*/
flexNotSupported_() {
const elem = document.createElement('i');

// Note: We don't actually use flexBasis (or flexOrder), but it's one of the more
// common flex features that we can rely on when checking for flex support.
return !('flexBasis' in elem.style ||
'webkitFlexBasis' in elem.style ||
'mozFlexBasis' in elem.style ||
'msFlexBasis' in elem.style ||
// IE10-specific (2012 flex spec), available for completeness
'msFlexOrder' in elem.style);
}

/**
* Set debug mode to enable/disable logs at info level.
*
Expand Down

0 comments on commit 34cbfde

Please sign in to comment.