Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
ignoring javascript?
  • Hi, The following issue might not be fuelphp related but I can't seem to find whether it is a problem on how the javascripts are loaded.
    (I bought an admin template "It's Brain" from themeforest. Live preview: http://themes.kopyov.com/?theme=Its Brain - admin theme)
    So I have a few jQuerys that are being loaded:
    <?php echo Asset::js('jquery-1.4.4.js'); ?>
    <?php echo Asset::js('spinner/jquery.mousewheel.js'); ?>
    <?php echo Asset::js('spinner/ui.spinner.js'); ?>
    [removed][removed]
    ...
    <?php echo Asset::js('jquery.ToTop.js'); ?>
    <?php echo Asset::js('jquery.listnav.js'); ?>
     
    <?php echo Asset::js('custom.js'); ?>
    

    Now the ToTop and listnav don't seem to work.
    For further information on the listNav check this website: http://www.ihwy.com/labs/jquery-listnav-plugin.aspx
    The custom.js contains all the configuration of the javascript uses:
    $(function() {
     
     
     //===== ToTop =====//
    
     $().UItoTop({ easingType: 'easeOutQuart' }); 
     
     //===== Contacts list =====//
     
     $('#myList').listnav({ 
      initLetter: 'a', 
      includeAll: true, 
      includeOther: true, 
      flagDisabled: true, 
      noMatchText: 'Nothing matched your filter, please click another letter.', 
      prefixes: ['the','a'] ,
     });
     
     ........
    

    This is the listView of my contacts (which uses the listnav)
    (fyi, this is loaded in a template)
    <div class="title"><h5>Clients list</h5></div>
    <div class="widget first">
     <div class="head"><h5 class="iUsers">Contacts</h5></div>
     <div id="myList-nav"></div>
     <ul id="myList">
     <?php foreach ($clients as $client): ?>
      <li>
      <a href="clients/view/<?php echo $client->id; ?>"><?php echo $client->lastname . " " . $client->firstname ; ?></a>
       <ul class="listData">
        <li><a href="#" title=""><?php echo $client->email; ?></a></li>
        <li><span class="red"><?php echo $client->phone; ?></span></li>
        <li><span class="cNote"><?php echo $client->category; ?></span></li>
       </ul>
      </li>
     <?php endforeach; ?>
     </ul>
    </div>
    

    and here you have the toTop in my template
    intsead of scrolling to the top it just jumps up.
    <a href="#" id="toTop">span id="toTopHover"></span>To Top</a>
    

    For some reason the custom.js isn't triggered although it is set as the last javascript.
    I also tried using the raw set to true. I'm not sure if this might help but here you have the loaded scripts with their timing from the firebug addon: not working (fuelphp):
    http://i42.tinypic.com/sdl16a.png working version (static html script):
    http://i42.tinypic.com/9vkxab.png
  • Now you lost me. You started this thread with a list of Asset::js() calls, that looks very FuelPHP to me...
  • k, I'll try to better explain ^^ So I bought an admintemplate which included an example of all its functionalities.
    I uploaded this example (which works) on my testserver to easily work and test from any computer. Now I'm making an admin panel for one of my websites which would include the admintemplate I bought. So for my website I have a template which is inherited by the Admin_Controller. In there I have included all javascripts files needed as written in the documentation (and as seen in the example they included). Now for some reason the javascripts aren't "activated'... They are there as I can see the generated code in firebug.... But the code that should for example have been generated by the javascript for the navlist isn't there in my code.
  • anyone able to help me further on this? Regards
  • Have you compared the HTML generated by FuelPHP with your static version? Any differences? Do they explain the behaviour?
  • Yes I compared both of them. So for the listnav you need to just create an empty div:
    <div id="myList-nav"></div>
    

    in my version with fuelphp the code isn't modified.
    As for the example the following is generated:
    <div id="myList-nav"><div class="ln-letters"><a href="#" class="all">ALL</a><a href="#" class="_ ln-disabled">0-9</a><a href="#" class="a ln-selected">A</a><a href="#" class="b">B</a><a href="#" class="c ln-disabled">C</a><a href="#" class="d ln-disabled">D</a><a href="#" class="e ln-disabled">E</a><a href="#" class="f ln-disabled">F</a><a href="#" class="g">G</a><a href="#" class="h ln-disabled">H</a><a href="#" class="i ln-disabled">I</a><a href="#" class="j ln-disabled">J</a><a href="#" class="k ln-disabled">K</a><a href="#" class="l ln-disabled">L</a><a href="#" class="m ln-disabled">M</a><a href="#" class="n ln-disabled">N</a><a href="#" class="o ln-disabled">O</a><a href="#" class="p ln-disabled">P</a><a href="#" class="q ln-disabled">Q</a><a href="#" class="r">R</a><a href="#" class="s ln-disabled">S</a><a href="#" class="t ln-disabled">T</a><a href="#" class="u ln-disabled">U</a><a href="#" class="v ln-disabled">V</a><a href="#" class="w ln-disabled">W</a><a href="#" class="x ln-disabled">X</a><a href="#" class="y ln-disabled">Y</a><a href="#" class="z ln-disabled">Z</a><a href="#" class="- ln-last">...</a></div><div class="ln-letter-count">0</div></div>
    
  • So FuelPHP generates exactly the same HTML as your static version?
  • No, as i said
    my website doesnt generate the code. But I tried the example which is included with the source codes that I bought and that works great.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion