import { AbstractModifier } from "./abstract.modifier" ; export class DefaultLeaderBoardFilterModifier extends AbstractModifier { protected defaultLeaderBoardFilter : string ; constructor ( defaultLeaderBoardFilter ) { super ( ) ; this . defaultLeaderBoardFilter = defaultLeaderBoardFilter ; } public modify ( ) { if ( this . defaultLeaderBoardFilter === "overall" ) { return ; } const view = Strava . Labs . Activities . SegmentLeaderboardView ; if ( ! view ) { return ; } const functionRender = view . prototype . render ; const that = this ; view . prototype . render = function ( ) { const r = functionRender . apply ( this , Array . prototype . slice . call ( arguments ) ) ; $ ( this . el ) . not ( ".once-only" ) . addClass ( "once-only" ) . find ( ".clickable[data-filter=" + that . defaultLeaderBoardFilter + "]" ) . click ( ) ; return r ; } ; } }