@@ -165,7 +165,7 @@ export default class {
165165 if ( saved . columnVisibility && ! isNone ( saved . columnVisibility [ id ] ) ) {
166166 return saved . columnVisibility [ id ] ;
167167 }
168- return this . columnSchema . findBy ( 'id' , id ) . visible ;
168+ return this . columnSchema . find ( ( x ) => x . id === id ) . visible ;
169169 }
170170
171171 /**
@@ -221,8 +221,8 @@ export default class {
221221 let diff = this . tableWidth - totalWidth ;
222222 while ( diff > 0 ) {
223223 columns
224- . filter ( ( col ) => col . visible )
225- . sortBy ( ' width' )
224+ . filter ( ( col ) => ! ! col . visible )
225+ . sort ( ( a , b ) => a . width - b . width )
226226 . forEach ( ( column ) => {
227227 if ( diff > 0 ) {
228228 column . width ++ ;
@@ -245,7 +245,7 @@ export default class {
245245 * @param {Number } width The column's new width
246246 */
247247 updateColumnWidth ( id , width ) {
248- let column = this . _columns . findBy ( 'id' , id ) ;
248+ let column = this . _columns . find ( ( x ) => x . id === id ) ;
249249 let previousWidth = column . width ;
250250 column . width = width ;
251251 let last = this . _columns [ this . _columns . length - 1 ] ;
@@ -265,7 +265,7 @@ export default class {
265265 * @param {String } id
266266 */
267267 toggleVisibility ( id ) {
268- let column = this . _columnVisibility . findBy ( 'id' , id ) ;
268+ let column = this . _columnVisibility . find ( ( x ) => x . id === id ) ;
269269 column . visible = ! column . visible ;
270270 if ( ! this . _columnVisibility . isAny ( 'visible' ) ) {
271271 // If this column was the last visible column
0 commit comments