Class: ClickCounterModel

ClickCounter ClickCounterModel

Creates an invisible iFrame that points to an desktopURL or mobileURL according to the state of isViewMobile respectively a given URL parameter. The iFrame gets refreshed when specific clicks are done.

new ClickCounterModel(desktopURL, mobileURL, staticLink)

modules/clickCounter/model.js, line 8
Name Type Description
desktopURL String URL that gets refreshed when in desktop mode
mobileURL String URL that gets refreshed when in mobile mode
staticLink String optional URL type to use ignoring isMobile mode. [desktop|mobile|undefined]
Properties:
Name Type Default Description
countframeid String _.uniqueId("countframe") Id of iframe.
desktopURL String "" Url to be used in iframe when app runs in desktop mode.
mobileURL String "" Url to be used in iframe when app runs in mobile mode.
isMobile Boolean false Boolean to indicate if view is in desktop or mobile mode.
Fires:
Listens to Events:

Extends

Methods

addIFrame2Body(){void}

modules/clickCounter/model.js, line 41
Adds an iFrame with a specific id and url to document.body

getURL(){String}

modules/clickCounter/model.js, line 86
Returns the string to use in the iFrame according to isViewMobile mode.
Returns:
URL to use in iFrame

refreshIframe(){void}

modules/clickCounter/model.js, line 135
Refreshes the iframe setting a specific URL

registerListener(){void}

modules/clickCounter/model.js, line 103
Register all the listener used in this model
Listens to Events:

requestIsViewMobile(){Boolean}

modules/clickCounter/model.js, line 56
Request isViewMobile state of page This seperate helper method enables unit tests of the setInitialIsMobile-method.
Fires:
Returns:
is view in mobile mode or not

setDesktopURL(value){void}

modules/clickCounter/model.js, line 147
setter for desktopURL
Name Type Description
value String desktopURL

setInitialIsMobile(){void}

modules/clickCounter/model.js, line 123
Sets initially isViewMobile-mode

setIsMobile(value){void}

modules/clickCounter/model.js, line 165
setter for isMobile
Name Type Description
value Boolean isMobile

setMobileURL(value){void}

modules/clickCounter/model.js, line 156
setter for mobileURL
Name Type Description
value String mobileURL

setURL(desktopURL, mobileURL, staticLink){void}

modules/clickCounter/model.js, line 67
Sets the iFrame URL for desktop and mobile state
Name Type Description
desktopURL String URL that gets refreshed when in desktop mode
mobileURL String URL that gets refreshed when in mobile mode
staticLink String optional URL to use ignoring mobile state