|
40 | 40 | *
|
41 | 41 | * @type string
|
42 | 42 | **/
|
43 |
| - Mobilebone.VERSION = '2.0.3'; |
| 43 | + Mobilebone.VERSION = '2.1.0'; |
44 | 44 |
|
45 | 45 | /**
|
46 | 46 | * Whether catch attribute of href from element with tag 'a'
|
|
248 | 248 | var onpagefirstinto = params_in.onpagefirstinto;
|
249 | 249 | if (!store[pageid]) {
|
250 | 250 | if (typeof onpagefirstinto == "string" && params_in.root[onpagefirstinto]) {
|
251 |
| - params_in.root[onpagefirstinto](pageInto, pageOut, options.response); |
| 251 | + params_in.root[onpagefirstinto](pageInto, pageOut, options); |
252 | 252 | } else if (typeof onpagefirstinto == "function") {
|
253 |
| - onpagefirstinto(pageInto, pageOut, options.response); |
| 253 | + onpagefirstinto(pageInto, pageOut, options); |
254 | 254 | }
|
255 | 255 | // capture form submit
|
256 | 256 | slice.call(pageInto.querySelectorAll("form")).forEach(function(form) {
|
|
275 | 275 | // bind animation events
|
276 | 276 | if (typeof animition == "string" && params_in.root[animition]) {
|
277 | 277 | pageInto.addEventListener(animateEventName, function() {
|
278 |
| - params_in.root[animition](this, this.classList.contains("in")? "into": "out"); |
| 278 | + params_in.root[animition](this, this.classList.contains("in")? "into": "out", options); |
279 | 279 | });
|
280 | 280 | } else if (typeof animition == "function") {
|
281 | 281 | pageInto.addEventListener(animateEventName, function() {
|
282 |
| - animition(this, this.classList.contains("in")? "into": "out"); |
| 282 | + animition(this, this.classList.contains("in")? "into": "out", options); |
283 | 283 | });
|
284 | 284 | }
|
285 | 285 | }
|
|
304 | 304 | var callback = params_in.callback;
|
305 | 305 |
|
306 | 306 | if (typeof callback == "string") callback = params_in.root[callback];
|
307 |
| - if (typeof callback == "function") callback.call(params_in.root, pageInto, pageOut, options.response); |
| 307 | + if (typeof callback == "function") callback.call(params_in.root, pageInto, pageOut, options); |
308 | 308 | }
|
309 | 309 | };
|
310 | 310 |
|
|
455 | 455 | if (typeof options.remove != "undefined") {
|
456 | 456 | optionsTransition.remove = options.remove;
|
457 | 457 | }
|
| 458 | + if (typeof options.target != "undefined") { |
| 459 | + optionsTransition.target = options.target; |
| 460 | + } |
458 | 461 | }
|
459 | 462 | this.transition(create_page, current_page, optionsTransition);
|
460 | 463 | };
|
|
534 | 537 | }
|
535 | 538 |
|
536 | 539 | params.url = this.getCleanUrl(trigger_or_options, params.url);
|
| 540 | + params.target = trigger_or_options; |
537 | 541 |
|
538 | 542 | var tagName = trigger_or_options.tagName.toLowerCase();
|
539 | 543 | if (tagName == "form") {
|
|
831 | 835 | if (back == false && rel == "auto") {
|
832 | 836 | back = Mobilebone.isBack(eleTargetPage, self_page);
|
833 | 837 | }
|
834 |
| - if (eleTargetPage) Mobilebone.transition(eleTargetPage, self_page, back); |
| 838 | + if (eleTargetPage) Mobilebone.transition(eleTargetPage, self_page, back, { |
| 839 | + target: target |
| 840 | + }); |
835 | 841 | event.preventDefault();
|
836 | 842 | } else if (/^javascript/.test(href)) {
|
837 | 843 | // back
|
|
848 | 854 | back = Mobilebone.isBack(store[clean_url], self_page);
|
849 | 855 | }
|
850 | 856 | Mobilebone.transition(store[clean_url], self_page, back, {
|
| 857 | + target: target, |
851 | 858 | id: clean_url
|
852 | 859 | });
|
853 | 860 | } else {
|
|
0 commit comments