VRFS-3245 : Hook up help hover bubbles

* Refactor common profile help bubble initialize convenience function
to profile_utils.
* Add new hover bubble text and hook up via HTML attribute on anchor tag
This commit is contained in:
Steven Miers 2015-05-31 09:53:28 -05:00
parent 540c3cc37f
commit 7f02ca5240
5 changed files with 37 additions and 26 deletions

View File

@ -286,17 +286,9 @@
inheritClass: true
})
initializeHelpBubbles()
profileUtils.initializeHelpBubbles($screen)
}
function initializeHelpBubbles() {
// Help bubbles (topics stored as attributes on element):
$(".help").each(function( index ) {
context.JK.helpBubble($(this), $(this).attr("help-topic"), {}, {})
})
}
this.initialize = initialize
this.beforeShow = beforeShow
this.afterShow = afterShow

View File

@ -12,6 +12,7 @@
var NONE_SPECIFIED = 'None specified'
var ui = new context.JK.UIHelper(JK.app)
var logger = context.JK.logger;
var profileUtils = context.JK.ProfileUtils;
var rest = context.JK.Rest();
var inviteMusiciansUtil = null;
var invitationDialog = null;
@ -29,8 +30,9 @@
var concertCount=null;
var currentStep = 0;
var STEPS_COUNT=5;
var $screen=$("#band-setup")
var $selectedInstruments=[]
function navBack() {
if (currentStep>0) {
saveBand(function() {
@ -61,7 +63,7 @@
}
function renderCurrentPage() {
$(".band-step").addClass("hidden")
$screen.find($(".band-step")).addClass("hidden")
$("#band-setup-step-" + currentStep).removeClass("hidden")
if(currentStep==0) {
$("#btn-band-setup-back").addClass("hidden")
@ -80,17 +82,17 @@
if(e){e.stopPropagation()}
// Is new member selected?
if ($('input[name="add_new_members"]:checked').val()=="yes") {
$(".new-member-dependent").removeClass("hidden")
if ($screen.find($('input[name="add_new_members"]:checked')).val()=="yes") {
$screen.find($(".new-member-dependent")).removeClass("hidden")
} else {
$(".new-member-dependent").addClass("hidden")
$screen.find($(".new-member-dependent")).addClass("hidden")
}
// Is paid gigs selected?
if ($('input[name="paid_gigs"]:checked').val()=="yes") {
$(".paid-gigs-dependent").removeClass("hidden")
$screen.find($(".paid-gigs-dependent")).removeClass("hidden")
} else {
$(".paid-gigs-dependent").addClass("hidden")
$screen.find($(".paid-gigs-dependent")).addClass("hidden")
}
return false;
}
@ -667,12 +669,13 @@
app.bindScreen('band/setup', screenBindings);
$('input[type=radio]')
.iCheck({
checkboxClass: 'icheckbox_minimal',
radioClass: 'iradio_minimal',
inheritClass: true
});
$('input[type=radio]').iCheck({
checkboxClass: 'icheckbox_minimal',
radioClass: 'iradio_minimal',
inheritClass: true
});
profileUtils.initializeHelpBubbles()
}
this.initialize = initialize;

View File

@ -43,6 +43,7 @@
};
profileUtils.gigMap = {
"": "not specified",
"0": "zero",
"1": "under 10",
"2": "10 to 50",
@ -83,6 +84,13 @@
return list;
}
// Initialize standard profile help bubbles (topics stored as attributes on element):
profileUtils.initializeHelpBubbles = function(parentElement) {
$(".help", parentElement).each(function( index ) {
context.JK.helpBubble($(this), $(this).attr("help-topic"), {}, {})
})
}
// profile genres
profileUtils.profileGenres = function(genres) {
var matches = $.grep(genres, function(g) {

View File

@ -105,7 +105,7 @@
td
label.strong-label for="new-member"
| We want to add a new member  
a.help help-topic="profile-interests-virtual-band" [?]
a.help help-topic="band-profile-add-new-member" [?]
td.new-member-dependent
label for="desired-experience"
| Desired Experience  
@ -138,7 +138,7 @@
td
label.strong-label for="paid-gigs"
| We want to play paid gigs  
a.help help-topic="profile-interests-paid-gigs" [?]
a.help help-topic="band-profile-play-paid-gigs" [?]
td.paid-gigs-dependent
label for="hourly-rate" Hourly Rate:
td.paid-gigs-dependent
@ -159,7 +159,7 @@
td
label.strong-label for="free-gigs"
| We want to play free gigs  
a.help help-topic="profile-interests-free-gigs" [?]
a.help help-topic="band-profile-play-free-gigs" [?]
tr
td
.radio-field

View File

@ -278,3 +278,11 @@ script type="text/template" id="template-help-profile-interests-free-sessions"
script type="text/template" id="template-help-profile-interests-cowrite-partners"
| For composers and songwriters who want to collaborate with others in composing and creating new music.
script type="text/template" id="template-help-band-profile-add-new-member"
| For bands that want to add one or more new members and let the JamKazam community of musicians know your band is looking for new members.
script type="text/template" id="template-help-band-profile-play-paid-gigs"
| For professional bands that are qualified and interested in playing paid gigs at music venues and other events.
script type="text/template" id="template-help-band-profile-play-free-gigs"
| For bands that are interested in playing free gigs, either for fun or to build experience.