Skip to content

Commit b70d426

Browse files
committedMay 31, 2018
Add minimal styling for smaller player
1 parent 9894409 commit b70d426

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "videojs-social-share-overlay",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"description": "Social share overlay for videojs",
55
"main": "dist/videojs-social-share-overlay.cjs.js",
66
"module": "dist/videojs-social-share-overlay.es.js",

‎src/plugin.js

+7
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,24 @@ class SocialShareOverlayPlugin {
166166
}
167167

168168
showShareOverlay() {
169+
const height = this.player.el().offsetHeight;
170+
169171
this.onSharePausedState = this.player.paused();
170172
this.player.pause();
171173
this.player.addClass("vjs-social-share-overlay-open");
172174
this.player.trigger('share-overlay-open');
175+
176+
if(height < 280) {
177+
this.player.addClass("vjs-social-share-overlay-minimal")
178+
}
173179
}
174180

175181
hideShareOverlay() {
176182
if(!this.onSharePausedState){
177183
this.player.play();
178184
}
179185
this.player.removeClass("vjs-social-share-overlay-open");
186+
this.player.removeClass("vjs-social-share-overlay-minimal");
180187
this.player.trigger('share-overlay-closed');
181188
}
182189

‎src/plugin.scss

+8
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
.vjs-share-overlay-controls {
5252
flex: none;
5353
max-width: 280px;
54+
min-width: 250px;
5455
width: 50%;
5556
}
5657

@@ -145,5 +146,12 @@
145146
}
146147

147148
}
149+
&.vjs-social-share-overlay.vjs-social-share-overlay-minimal {
150+
.vjs-share-overlay {
151+
.vjs-share-overlay-footer {
152+
display: none;
153+
}
154+
}
155+
}
148156
}
149157
}

0 commit comments

Comments
 (0)
Please sign in to comment.