Git Product home page Git Product logo

Comments (16)

papaiatis avatar papaiatis commented on July 30, 2024 3

Got it! new Offcanvas($('[data-toggle="offcanvas"]'));

from bootstrap-offcanvas.

iamphill avatar iamphill commented on July 30, 2024

Do you have a demo app that you could share?

from bootstrap-offcanvas.

papaiatis avatar papaiatis commented on July 30, 2024

I've made you one: http://plnkr.co/edit/ZmUVTgp6xJctlZ0Xk14R?p=preview
The trick is ng-include which loads the specified html file into that exact spot.

from bootstrap-offcanvas.

iamphill avatar iamphill commented on July 30, 2024

Thanks! I'll look into getting a fix for this 😄

from bootstrap-offcanvas.

papaiatis avatar papaiatis commented on July 30, 2024

Thanks! It would be awesome if you could fix it soon 😉

from bootstrap-offcanvas.

papaiatis avatar papaiatis commented on July 30, 2024

Any update on this? I'm eager to intergrate it into my website!

from bootstrap-offcanvas.

iamphill avatar iamphill commented on July 30, 2024

Unfortunately it's s bit harder than I originally though. I think I need to do a bit of a refactor of how it works, which is something I want to do anyway. However I don't have the time to do this at the moment.

Is there anyway you can use the class I've created? It should be a global object that you should be able to init from in angular.

from bootstrap-offcanvas.

papaiatis avatar papaiatis commented on July 30, 2024

That could work. How can I initialize your class?

from bootstrap-offcanvas.

iamphill avatar iamphill commented on July 30, 2024

You should be able to use new Offcanvas(TOGGLE ELEMENT)

from bootstrap-offcanvas.

papaiatis avatar papaiatis commented on July 30, 2024

Sorry, but I'm not sure what to write into TOGGLE ELEMENT.
I have this as a toggle button:

<button type="button" class="navbar-toggle offcanvas-toggle ng-scope" data-toggle="offcanvas" data-target="#js-bootstrap-offcanvas">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
</button>

I copied it from your example: http://iamphill.github.io/Bootstrap-Offcanvas/example.html

from bootstrap-offcanvas.

papaiatis avatar papaiatis commented on July 30, 2024

In the meanwhile I've updated the Plunkr code. Look for the "init Offcanvas here" line. That should be the place to put your Offcanvas init logic.

http://plnkr.co/edit/ZmUVTgp6xJctlZ0Xk14R?p=preview

from bootstrap-offcanvas.

iamphill avatar iamphill commented on July 30, 2024

I'll fork the plunkr & get it working 😄

from bootstrap-offcanvas.

iamphill avatar iamphill commented on July 30, 2024

Nice one! I was just about to send it back with that!

Happy to close?

from bootstrap-offcanvas.

papaiatis avatar papaiatis commented on July 30, 2024

Sure I am! Thanks a lot :-) Amazing support!

from bootstrap-offcanvas.

iamphill avatar iamphill commented on July 30, 2024

You're welcome! 👍

from bootstrap-offcanvas.

kingkero avatar kingkero commented on July 30, 2024

This should be way more prominent! Have been trying make this plugin work with RequireJS for a couple of hours.

require.config({
  shim: {
    bootstrap: {
      deps: ['jquery']
    },
    bootstrapOffcanvas: {
      deps: ['jquery', 'bootstrap'],
      exports: 'Offcanvas'
    },
  },
  paths: {
    jquery: '../bower_components/jquery/dist/jquery',
    bootstrap: '../bower_components/bootstrap-sass-official/assets/javascripts/bootstrap',
    bootstrapOffcanvas: '../bower_components/bootstrap-offcanvas/dist/js/bootstrap.offcanvas.min'
  }
});

And just new Offcanvas($('[data-toggle="offcanvas"]')); in the render function after loading the template

from bootstrap-offcanvas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.