|
34 | 34 | }
|
35 | 35 |
|
36 | 36 | $(document).unbind(".linkhandler");
|
37 |
| - $(document).bind( "click", function(event, isRefresh) { |
| 37 | + $(document).bind( "click", function(event) { |
38 | 38 | var link = findClosestLink(event.target);
|
39 | 39 | if (!link){
|
40 | 40 | return;
|
|
79 | 79 | //if data-ajax attr is set to false, use the default behavior of a link
|
80 | 80 | hasAjaxDisabled = $link.is(":jqmData(ajax='false')"),
|
81 | 81 |
|
| 82 | + isRefresh=$link.jqmData('refresh'), |
82 | 83 | $targetPanel=$link.jqmData('panel'),
|
83 | 84 | $targetContainer=$('div:jqmData(id="'+$targetPanel+'")'),
|
84 | 85 | $targetPanelActivePage=$targetContainer.children('div.'+$.mobile.activePageClass),
|
|
103 | 104 | return;
|
104 | 105 | }
|
105 | 106 |
|
106 |
| - $activeClickedLink = $link.closest( ".ui-btn" ); |
| 107 | + //still need this hack apparently: |
| 108 | + $('.ui-btn.'+$.mobile.activeBtnClass).removeClass($.mobile.activeBtnClass); |
| 109 | + $activeClickedLink = $link.closest( ".ui-btn" ).addClass($.mobile.activeBtnClass); |
107 | 110 |
|
108 | 111 | if( isExternal || hasAjaxDisabled || hasTarget || !$.mobile.ajaxEnabled ||
|
109 | 112 | // TODO: deprecated - remove at 1.0
|
|
398 | 401 | panelContextSelector = $this.parents('div[data-role="panel"]').jqmData('context'),
|
399 | 402 | pageContextSelector = $this.jqmData('context'),
|
400 | 403 | contextSelector= pageContextSelector ? pageContextSelector : panelContextSelector;
|
401 |
| - if(contextSelector && $this.find(contextSelector).length){ |
402 |
| - $this.find(contextSelector).trigger('click', true); |
| 404 | + //if you pass a hash into data-context, you need to specify panel, url and a boolean value for refresh |
| 405 | + if $.type(contextSelector) === 'object' { |
| 406 | + var $targetContainer=$(':jqmData(id="'+contextSelector.panel'")'), |
| 407 | + $targetPanelActivePage==$targetContainer.children('div.'+$.mobile.activePageClass), |
| 408 | + isRefresh = contextSelector.refresh === undefined ? false : contextSelector.refresh; |
| 409 | + $.mobile.changePage([$targetPanelActivePage, contextSelector.url],'fade', reverse, false, undefined, $targetContainer, isRefresh); |
| 410 | + } |
| 411 | + else if(contextSelector && $this.find(contextSelector).length){ |
| 412 | + $this.find(contextSelector).trigger('click'); |
403 | 413 | }
|
404 | 414 | });
|
405 | 415 |
|
|
0 commit comments