opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

Navigation using data-ajax="false" not working for other file #129

Closed rodcloutier closed 11 years ago

rodcloutier commented 11 years ago

When trying to link to a local pdf file, using data-ajax="false", clicking on the link will result in a page displaying undefined. It loads the content of the pdf file in the jquerymobile page. It seems that the data-ajax="false" is not respected.

The same markup used with only jquery mobile scripts will properly display the pdf file when clicking the link.

<html lang="en">
    <head>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
        <!-- Using the standard include, the pdf is displayed when the button is clicked -->
        <!-- <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> -->
        <!-- <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> -->
        <!-- Using angular adapter, clicking the button results in a page displaying undefined -->
        <script src="https://github.com/tigbro/jquery-mobile-angular-adapter/raw/master/compiled/jquery-mobile-angular-adapter-standalone-1.2.0.js" type="text/javascript"></script>
    </head>
    <body ng-app>
        <div data-role="page">
            <a href="sample.pdf" data-role="button" data-ajax="false">Pdf file</a>
        </div>
    </body>
</html>
tbosch commented 11 years ago

A workaround is to use <a href="sample.pdf" data-rel="external">Pdf file</a>.

tbosch commented 11 years ago

Thanks for the pull request and especially one including unit tests!! I am happy for every contribution!

By the way, I refactored a lot of the code of the adapter this week. My goal was clean code, and also to make it easier to create adapters for custom jquery mobile plugins. Have a look at https://github.com/tigbro/jquery-mobile-angular-adapter/blob/master/src/main/webapp/integration/jqmNgWidgetProvider.js

Thanks again! Tobias

rodcloutier commented 11 years ago

You are right. I thought I had tried it but I must have made a mistake.

On 2013-03-01, at 10:57, Tobias Bosch notifications@github.com wrote:

A workaround is to use Pdf file.

— Reply to this email directly or view it on GitHub.