Advertisement web component <cq-advertisement>
.
Displays an advertisement banner as a "marker" (inside the chart, use CSS to position absolutely against the chart panel). The advertisement should contain content that can be enabled by calling CIQ.UI.Advertisement#show based on your business logic.
The advertisement will automatically adjust the height to accommodate the content (assuming overflow-y: auto)
Example
<cq-advertisement style="display: block; height: 106px;">
<cq-close class="ciq-tight"></cq-close>
<div class="sample ciq-show">
<div cq-desktop="">
<div>$1 Trades</div>
<div>
Use code <strong>Sample</strong>
</div>
<a target="_blank" href="https://yourURL?codeSample&desktop">
Click to learn more
</a>
</div>
<div cq-phone="">
<div>$1 Trades</div>
<a target="_blank" href="https://yourURL?codeSample&mobile">
Click to learn more
</a>
</div>
</div>
</cq-advertisement>
Methods
-
Advertisement#close()
-
Hides the advertisement and suppresses it for 24 hours by storing it in local storage. If the selector itself changes however then the ad will reappear.
-
Advertisement#setSleepAmount(units, unitType)
-
Sets the sleep time for this amount of time before re-displaying
Parameters:
Name Type Description units
Number Units
unitType
string Unit type. Value values "minute","hour","day","week"
-
Advertisement#watchForRemoteClose( [ms])
-
Call this to force the advertisement to monitor the nameValueStore for updates. It will do this by polling. This is useful when running in multiple windows, do that if the advertisement is closed in one window then it will automatically close in the other windows.
Parameters:
Name Type Argument Default Description ms
Number <optional>
1000 Number of milliseconds to poll.