intel / appframework

The definitive HTML5 mobile javascript framework
http://app-framework-software.intel.com/
MIT License
2.43k stars 882 forks source link

Upgrading from Older App Framework - Issue with SideMenu #794

Closed solepixel closed 9 years ago

solepixel commented 9 years ago

I used the App with Side Menu sample to start off with and realized that the base code was using an older version of the App Framework.

I upgraded to the latest (2.1.0) and now I'm getting an error in the console whenever I scroll inside a panel or click the Menu Toggle icon (that fires $.ui.toggleSideMenu() ). There are 2 errors that display:

Uncaught TypeError: Object # has no method 'getSideMenuPosition' af.slidemenu.js:60 Uncaught TypeError: Object # has no method 'isAsideMenuEnabled' af.slidemenu.js:82

I have no idea what is wrong and what changed between the versions. Here's my init code:

<script>
    var onDeviceReady = function(){                             // called when Cordova is ready
        if( window.Cordova && navigator.splashscreen ) {        // Cordova API detected
            $.ui.launch();
            navigator.splashscreen.hide();                      // hide splash screen
        }
    };

    document.addEventListener("deviceready", onDeviceReady, false) ;
</script>
<script>
    $.ui.autoLaunch = true;
    $.ui.animateHeaders = false;

    $(function(){
        $.ui.setSideMenuWidth('260px');
        $.ui.launch();
    });
</script>

Most of the code is directly from the original example. What am I doing wrong?

solepixel commented 9 years ago

Also, the scripts I'm embedding are:

<script type="text/javascript" charset="utf-8" src="appframework/appframework.ui.min.js"></script>
<script type="text/javascript" charset="utf-8" src="appframework/plugins/af.slidemenu.js"></script>
solepixel commented 9 years ago

Nevermind, I realize now that I needed to change my reference to use appframework/build/ui/appframework.ui.min.js