From 9212804eae285c35cccc1165439e1157ad694289 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Tue, 24 May 2016 21:05:31 -0500 Subject: [PATCH] VRFS-4118 - pulse side box --- ruby/lib/jam_ruby/models/connection.rb | 2 +- web/app/assets/javascripts/helpBubbleHelper.js | 10 ++++++++-- .../react-components/TeacherProfile.js.jsx.coffee | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ruby/lib/jam_ruby/models/connection.rb b/ruby/lib/jam_ruby/models/connection.rb index c65c53621..b8a2afdaf 100644 --- a/ruby/lib/jam_ruby/models/connection.rb +++ b/ruby/lib/jam_ruby/models/connection.rb @@ -188,7 +188,7 @@ module JamRuby unless tracks.nil? tracks.each do |track| t = Track.new - t.instrument = Instrument.find(track["instrument_id"]) + t.instrument = Instrument.find_by_id(track["instrument_id"]) || Instrument.find('acoustic guitar') t.connection = self t.sound = track["sound"] t.client_track_id = track["client_track_id"] diff --git a/web/app/assets/javascripts/helpBubbleHelper.js b/web/app/assets/javascripts/helpBubbleHelper.js index f732cce13..f6b7622f0 100644 --- a/web/app/assets/javascripts/helpBubbleHelper.js +++ b/web/app/assets/javascripts/helpBubbleHelper.js @@ -81,6 +81,10 @@ } } + function subtlePulse($element) { + $element.find('.bt-content').pulse({'background-color' : '#868686'}, {pulses: 3}, function() { $element.css('background-color', '#980006')}) + } + helpBubble.rotateJamTrackLandingBubbles = function($preview, $video, $ctaButton, $alternativeCta) { $(window).on('load', function() { setTimeout(function() { @@ -198,7 +202,8 @@ helpBubble.showBuyTestDrive = function($element, $offsetParent, user, callback) { return context.JK.onceBubble($element, 'side-buy-test-drive', user, {offsetParent:$offsetParent, width:260, positions:['right'], postShow: function(container) { - var $bookNow = $('a.book-now') + subtlePulse(container) + var $bookNow = container('a.book-now') $bookNow.off('click').on('click', function(e) { e.preventDefault() callback() @@ -209,6 +214,7 @@ helpBubble.showBuyNormalLesson = function($element, $offsetParent, user, callback) { return context.JK.onceBubble($element, 'side-buy-normal-lesson', user, {offsetParent:$offsetParent, width:260, positions:['right'], postShow: function(container) { + subtlePulse(container) var $bookNow = container.find('a.book-now') $bookNow.off('click').on('click', function(e) { e.preventDefault() @@ -220,8 +226,8 @@ helpBubble.didntFindTeacher = function($element, $offsetParent, user, callback) { return context.JK.onceBubble($element, 'side-didnt-find-teacher', user, {offsetParent:$offsetParent, width:260, positions:['right'], postShow: function(container) { + subtlePulse(container) var $bookNow = container.find('a.post-help') - console.log("container", $bookNow) $bookNow.off('click').on('click', function(e) { e.preventDefault() callback(container.find('.note').val(), container.find('.email').val(), container.find('.phonenumber').val()) diff --git a/web/app/assets/javascripts/react-components/TeacherProfile.js.jsx.coffee b/web/app/assets/javascripts/react-components/TeacherProfile.js.jsx.coffee index 30a04c493..76fb3f42b 100644 --- a/web/app/assets/javascripts/react-components/TeacherProfile.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/TeacherProfile.js.jsx.coffee @@ -102,7 +102,10 @@ proficiencyDescriptionMap = { showSideBubbleWhenReady: () -> if @user? && @state.user? if @visible - @showSideBubble() + setTimeout((() => ( + if @visible + @showSideBubble() + )), 5000) beforeHide: (e) -> @visible = false