Commits

Chris Mutel  committed 0a7db64

file picker fixed replacing text

  • Participants
  • Parent commits 33a26c8

Comments (0)

Files changed (2)

File bw2ui/web/static/jqueryFileTree/jqueryFileTree.js

 								$(this).parent().find('UL').remove(); // cleanup
 								// showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) );
 								// RE breaks everything!?
+								if (typeof(fpselector) == typeof(Function)) {
+									fpselector($(this));
+								}
 								showTree( $(this).parent(), escape($(this).attr('rel')) );
 								$(this).parent().removeClass('collapsed').addClass('expanded');
 							} else {

File bw2ui/web/templates/fp.html

 
 {% block extrahead %}
 <link rel="stylesheet" href="{{ url_for('static', filename="jqueryFileTree/jqueryFileTree.css") }}" type="text/css" media="screen, projection">
-<script src="{{ url_for('static', filename="jqueryFileTree/jqueryFileTree.js") }}"></script>
 {% endblock %}
 
 {% block body %}
 
 <div id="fp"></div>
 
-
+<script type="text/javascript">
+function fpselector (a) {
+  $("#fp-selected").text(a.attr('rel'));
+};
+</script>
+<script src="{{ url_for('static', filename="jqueryFileTree/jqueryFileTree.js") }}"></script>
 <script type="text/javascript">      
 $(document).ready( function() {        
   $('#fp').fileTree({
     function(file) { 
       console.log(file);
     }
-  );        
-
-  $("#fp .directory").click(function () {
-    console.log($(this).attr('rel'));
-    $("#fp-selected").text($(this).attr('rel'));
-  });
+  );
 });
 </script>
 {% endblock %}