Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

attach stopping procedure to event of player instead of button

  • Loading branch information...
commit de47b01f3a10298701dc46a6adc1628b2fb12a9a 1 parent 5e3a432
Alexey Zakhlestin indeyets authored

Showing 2 changed files with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 4 code.js
  2. +1 1  tmradio.manifest
9 code.js
@@ -195,6 +195,9 @@ tmradio.iphone = {
195 195 tmradio.iphone.is_playing = true;
196 196 tmradio.iphone.getCurrentTrackInfo();
197 197 })
  198 + .on('pause', function(){
  199 + tmradio.iphone.stop();
  200 + })
198 201 .on('emptied', function(){ $('#results_ul').text('Error'); })
199 202 .get(0).play();
200 203 },
@@ -206,9 +209,7 @@ tmradio.iphone = {
206 209 $('#vote_actions').hide();
207 210 $('#login_ul').hide();
208 211
209   - var player = $('#tmRadio');
210   - player.get(0).pause();
211   - player.remove();
  212 + $('#tmRadio').remove();
212 213
213 214 tmradio.iphone.is_playing = false;
214 215 tmradio.iphone.track_info = null;
@@ -315,7 +316,7 @@ tmradio.iphone = {
315 316 tmradio.iphone.s = $('#stop');
316 317
317 318 tmradio.iphone.p.click(tmradio.iphone.play)
318   - tmradio.iphone.s.click(tmradio.iphone.stop)
  319 + tmradio.iphone.s.click(function(){ $('#tmRadio').trigger('pause'); })
319 320
320 321 $('#save_token_btn').click(tmradio.iphone.saveToken);
321 322 $('#request_token_btn').click(tmradio.iphone.requestToken)
2  tmradio.manifest
... ... @@ -1,6 +1,6 @@
1 1 CACHE MANIFEST
2 2 #
3   -# Cache manifest version 28
  3 +# Cache manifest version 29
4 4 #
5 5 code.js
6 6 cover.png

0 comments on commit de47b01

Please sign in to comment.
Something went wrong with that request. Please try again.