Diffstat (limited to 'frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js b/frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js new file mode 100644 index 0000000..94f3d9b --- a/dev/null +++ b/frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | |||
3 | _/ _/_/ _/_/_/_/_/ _/ | ||
4 | _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/ | ||
5 | _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ | ||
6 | _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ | ||
7 | _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/ | ||
8 | _/ | ||
9 | _/ | ||
10 | |||
11 | Created by David Kaneda <http://www.davidkaneda.com> | ||
12 | Maintained by Thomas Yip <http://beedesk.com/> | ||
13 | Sponsored by Sencha Labs <http://www.sencha.com/> | ||
14 | Special thanks to Jonathan Stark <http://www.jonathanstark.com/> | ||
15 | |||
16 | Documentation and issue tracking on GitHub <http://github.com/senchalabs/jQTouch/> | ||
17 | |||
18 | (c) 2009-2011 Sencha Labs | ||
19 | jQTouch may be freely distributed under the MIT license. | ||
20 | |||
21 | */ | ||
22 | |||
23 | (function($) { | ||
24 | if ($.jQTouch) | ||
25 | { | ||
26 | $.jQTouch.addExtension(function AutoTitles(jQT){ | ||
27 | |||
28 | var titleSelector='.toolbar h1'; | ||
29 | |||
30 | $(function(){ | ||
31 | $('#jqt').bind('pageAnimationStart', function(e, data){ | ||
32 | if (data.direction === 'in'){ | ||
33 | var $title = $(titleSelector, $(e.target)); | ||
34 | var $ref = $(e.target).data('referrer'); | ||
35 | if ($title.length && $ref && $title.text() === ''){ | ||
36 | $title.html($ref.text()); | ||
37 | } | ||
38 | } | ||
39 | }); | ||
40 | }); | ||
41 | |||
42 | function setTitleSelector(ts){ | ||
43 | titleSelector=ts; | ||
44 | } | ||
45 | |||
46 | return { | ||
47 | setTitleSelector: setTitleSelector | ||
48 | }; | ||
49 | |||
50 | }); | ||
51 | } | ||
52 | })($); | ||