Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Added the option to specify the platforms where smart banner is shown #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jquery.smartbanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

// Don't show banner if device isn't iOS or Android, website is loaded in app or user dismissed banner
if (!this.type || standalone || this.getCookie('sb-closed') || this.getCookie('sb-installed')) {
if (!this.type || $.inArray(this.type, this.options.platforms) === -1 || standalone || this.getCookie('sb-closed') || this.getCookie('sb-installed')) {
return
}

Expand Down Expand Up @@ -274,7 +274,8 @@
layer: false, // Display as overlay layer or slide down the page
iOSUniversalApp: true, // If the iOS App is a universal app for both iPad and iPhone, display Smart Banner to iPad users, too.
appendToSelector: 'body', //Append the banner to a specific selector
pushSelector: 'html' // What element is going to push the site content down; this is where the banner append animation will start.
pushSelector: 'html', // What element is going to push the site content down; this is where the banner append animation will start.
platforms: ['ios', 'android', 'windows', 'kindle'] // The platforms where the Smart banner will be displayed
}

$.smartbanner.Constructor = SmartBanner;
Expand Down