Browse Source

Add bunch of JSDocs

j8
Ilya Daynatovich 8 years ago
parent
commit
69e4f49e74
1 changed files with 41 additions and 0 deletions
  1. 41
    0
      modules/UI/videolayout/FilmStrip.js

+ 41
- 0
modules/UI/videolayout/FilmStrip.js View File

117
         }
117
         }
118
     },
118
     },
119
 
119
 
120
+    /**
121
+     * Shows if filmstrip is visible
122
+     * @returns {boolean}
123
+     */
120
     isFilmStripVisible() {
124
     isFilmStripVisible() {
121
         return !this.filmStrip.hasClass('hidden');
125
         return !this.filmStrip.hasClass('hidden');
122
     },
126
     },
128
         });
132
         });
129
     },
133
     },
130
 
134
 
135
+    /**
136
+     * Returns the height of filmstrip
137
+     * @returns {number} height
138
+     */
131
     getFilmStripHeight() {
139
     getFilmStripHeight() {
132
         if (this.isFilmStripVisible()) {
140
         if (this.isFilmStripVisible()) {
133
             return this.filmStrip.outerHeight();
141
             return this.filmStrip.outerHeight();
136
         }
144
         }
137
     },
145
     },
138
 
146
 
147
+    /**
148
+     * Returns the width of filmstip
149
+     * @returns {number} width
150
+     */
139
     getFilmStripWidth() {
151
     getFilmStripWidth() {
140
         return this.filmStrip.innerWidth()
152
         return this.filmStrip.innerWidth()
141
             - parseInt(this.filmStrip.css('paddingLeft'), 10)
153
             - parseInt(this.filmStrip.css('paddingLeft'), 10)
142
             - parseInt(this.filmStrip.css('paddingRight'), 10);
154
             - parseInt(this.filmStrip.css('paddingRight'), 10);
143
     },
155
     },
144
 
156
 
157
+    /**
158
+     * Calculates the size for thumbnails: local and remote one
159
+     * @returns {*|{localVideo, remoteVideo}}
160
+     */
145
     calculateThumbnailSize() {
161
     calculateThumbnailSize() {
146
         let availableSizes = this.calculateAvailableSize();
162
         let availableSizes = this.calculateAvailableSize();
147
         let width = availableSizes.availableWidth;
163
         let width = availableSizes.availableWidth;
184
         return { localRatio, remoteRatio };
200
         return { localRatio, remoteRatio };
185
     },
201
     },
186
 
202
 
203
+    /**
204
+     * Calculates available size for one thumbnail according to
205
+     * the current window size
206
+     * @returns {{availableWidth: number, availableHeight: number}}
207
+     */
187
     calculateAvailableSize() {
208
     calculateAvailableSize() {
188
         let availableHeight = interfaceConfig.FILM_STRIP_MAX_HEIGHT;
209
         let availableHeight = interfaceConfig.FILM_STRIP_MAX_HEIGHT;
189
         let thumbs = this.getThumbs(true);
210
         let thumbs = this.getThumbs(true);
259
         return { availableWidth, availableHeight };
280
         return { availableWidth, availableHeight };
260
     },
281
     },
261
 
282
 
283
+    /**
284
+     * Takes the available size for thumbnail and calculates
285
+     * final size of thumbnails
286
+     * @param availableWidth
287
+     * @param availableHeight
288
+     * @returns {{localVideo, remoteVideo}}
289
+     */
262
     calculateThumbnailSizeFromAvailable(availableWidth, availableHeight) {
290
     calculateThumbnailSizeFromAvailable(availableWidth, availableHeight) {
263
         let { localRatio, remoteRatio } = this.normalizeThumbnailRatio();
291
         let { localRatio, remoteRatio } = this.normalizeThumbnailRatio();
264
         let { remoteThumbs } = this.getThumbs(true);
292
         let { remoteThumbs } = this.getThumbs(true);
289
         };
317
         };
290
     },
318
     },
291
 
319
 
320
+    /**
321
+     * Resizes thumbnails
322
+     * @param local
323
+     * @param remote
324
+     * @param animate
325
+     * @param forceUpdate
326
+     * @returns {Promise}
327
+     */
292
     resizeThumbnails(local, remote,
328
     resizeThumbnails(local, remote,
293
                       animate = false, forceUpdate = false) {
329
                       animate = false, forceUpdate = false) {
294
 
330
 
327
         });
363
         });
328
     },
364
     },
329
 
365
 
366
+    /**
367
+     * Returns thumbnails of the filmstrip
368
+     * @param only_visible
369
+     * @returns {object} thumbnails
370
+     */
330
     getThumbs(only_visible = false) {
371
     getThumbs(only_visible = false) {
331
         let selector = 'span';
372
         let selector = 'span';
332
         if (only_visible) {
373
         if (only_visible) {

Loading…
Cancel
Save