steal.js not working with jquery

365 views Asked by At

I am using jquery 1.7.2 which supports raphael.js and highlighter.js and it works fine. Now when I load steal.js( for dragging a div within specified limits), the jquery becomes void and the mentioned javascripts stop working. I am unable to understand what problem does steal.js create here.

The code for steal.js functionality to drag is:

<script type='text/javascript' src='../../javascriptmvc/steal/steal.js'> </script>              
            steal("jquerypp/event/drag",
                "jquerypp/event/drag/scroll",
                "jquerypp/event/drag/limit").then(function(){

             $("#svg-container").delegate(".handle","draginit",function(ev, drag){drag.limit( $("#svg-container") )}) 

            }); 
1

There are 1 answers

0
ccummings On BEST ANSWER

Stealing any jquerypp feature will also steal jQuery since it is a dependency. If you look at stealconfig.js, you'll see the location Steal is using to retrieve jQuery (by defualt it is can/lib/jquery.1.9.1.js).

Since jQuery exposes itself globally, the jQuery that is stolen is clobbering the one you loaded in the page before using steal.

If you are going to use steal, I'd suggest loading all of your JavaScript files using it.