How to use material-components-web - 10 common examples

To help you get started, we’ve selected a few material-components-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chriscamicas / girr / client / src / components / Topic / TopicCard.vue View on Github external
mounted () {
    // code here executes once the component is rendered
    autoInit(this.$el) // reapply MDCRipple to all mdc-list-item
  },
  methods: {
github InterDigitalInc / AdvantEDGE / examples / demo1 / src / demo-frontend / src / js / demo-svc.js View on Github external
$(document).ready(function () {

    // Initialize variables
    drawer = new mdc.drawer.MDCPersistentDrawer(document.querySelector('#main-drawer'));
    refreshIntervalTextfield = new mdc.textField.MDCTextField(document.querySelector('#refresh-interval-tf-div'));

    // Register event listeners
    $('.idcc-toolbar-menu').on('click', function () {
        drawer.open = !drawer.open;
    });

    const activatedClass = 'mdc-list-item--selected';
    $('.mdc-drawer__drawer').on('click', function (event) {
        var target = event.target;
        while (target && !$(target).hasClass('mdc-list-item')) {
            target = target.parentElement;
        }
        if (target) {
            $('.' + activatedClass).removeClass(activatedClass);
            $(event.target).addClass(activatedClass);
            setMainContent(target.id);
github chriscamicas / girr / client / src / components / Bottombar.vue View on Github external
mounted () {
    this.menu = new menu.MDCSimpleMenu(this.$el.querySelector('.bottombar-menu'))
    // Add event listener to some button to toggle the menu on and off.
    this.$el.querySelector('.toggle-menu').addEventListener('click', (event) => {
      event.stopPropagation()
      event.preventDefault()
      this.scenesMenu.open = false
      this.menu.open = !this.menu.open
    })

    this.scenesMenu = new menu.MDCSimpleMenu(this.$el.querySelector('.scenes-menu'))
    // Add event listener to some button to toggle the menu on and off.
    this.$el.querySelector('.toggle-scenes-menu').addEventListener('click', (event) => {
      event.stopPropagation()
      event.preventDefault()
      this.menu.open = false
      this.scenesMenu.open = !this.scenesMenu.open
    })
  },
  methods: {
github chriscamicas / girr / client / src / components / Episode / EpisodeCard.vue View on Github external
mounted () {
    this.menu = new menu.MDCSimpleMenu(this.$el.querySelector('.mdc-simple-menu'))
    // Add event listener to some button to toggle the menu on and off.
    this.$el.querySelector('.toggle-menu').addEventListener('click', (event) => {
      event.preventDefault()
      this.menu.open = !this.menu.open
    })
  },
  methods: {
github chriscamicas / girr / client / src / components / Bottombar.vue View on Github external
mounted () {
    this.menu = new menu.MDCSimpleMenu(this.$el.querySelector('.bottombar-menu'))
    // Add event listener to some button to toggle the menu on and off.
    this.$el.querySelector('.toggle-menu').addEventListener('click', (event) => {
      event.stopPropagation()
      event.preventDefault()
      this.scenesMenu.open = false
      this.menu.open = !this.menu.open
    })

    this.scenesMenu = new menu.MDCSimpleMenu(this.$el.querySelector('.scenes-menu'))
    // Add event listener to some button to toggle the menu on and off.
    this.$el.querySelector('.toggle-scenes-menu').addEventListener('click', (event) => {
      event.stopPropagation()
      event.preventDefault()
      this.menu.open = false
      this.scenesMenu.open = !this.scenesMenu.open
    })
github chriscamicas / girr / client / src / components / Episode / Episode.vue View on Github external
mounted () {
    this.menu = new menu.MDCSimpleMenu(this.$el.querySelector('.mdc-toolbar__section .mdc-simple-menu'))
    // Add event listener to some button to toggle the menu on and off.
    this.$el.querySelector('.mdc-toolbar__section  .toggle-menu').addEventListener('click', (event) => {
      event.preventDefault()
      this.menu.open = !this.menu.open
    })
  },
  watch: {
github chriscamicas / girr / client / src / components / Program / ProgramCard.vue View on Github external
mounted () {
    this.menu = new menu.MDCSimpleMenu(this.$el.querySelector('.mdc-simple-menu'))
    // Add event listener to some button to toggle the menu on and off.
    this.$el.querySelector('.toggle-menu').addEventListener('click', (event) => {
      event.preventDefault()
      this.menu.open = !this.menu.open
    })
  },
  methods: {
github ngageoint / mage-server / public / app / observation / form / checkbox.edit.js View on Github external
const MDCCheckbox = require('material-components-web').checkbox.MDCCheckbox
  , MDCFormField = require('material-components-web').formField.MDCFormField;

module.exports = {
  template: require('./checkbox.edit.html'),
  bindings: {
    field: '<'
  },
  controller: ['$element', function($element) {
    this.$postLink = function() {
      // $timeout(function() {
        var checkbox = new MDCCheckbox($element.find('.mdc-checkbox')[0])
        var formField = new MDCFormField($element.find('.mdc-form-field')[0])
        formField.input = checkbox;
      // }.bind(this))
    }
  }]
github ngageoint / mage-server / public / app / observation / form / checkbox.edit.js View on Github external
const MDCCheckbox = require('material-components-web').checkbox.MDCCheckbox
  , MDCFormField = require('material-components-web').formField.MDCFormField;

module.exports = {
  template: require('./checkbox.edit.html'),
  bindings: {
    field: '<'
  },
  controller: ['$element', function($element) {
    this.$postLink = function() {
      // $timeout(function() {
        var checkbox = new MDCCheckbox($element.find('.mdc-checkbox')[0])
        var formField = new MDCFormField($element.find('.mdc-form-field')[0])
        formField.input = checkbox;
      // }.bind(this))
    }
  }]
};
github InterDigitalInc / AdvantEDGE / examples / demo1 / src / demo-frontend / src / js / demo-svc.js View on Github external
$(document).ready(function () {

    // Initialize variables
    drawer = new mdc.drawer.MDCPersistentDrawer(document.querySelector('#main-drawer'));
    refreshIntervalTextfield = new mdc.textField.MDCTextField(document.querySelector('#refresh-interval-tf-div'));

    // Register event listeners
    $('.idcc-toolbar-menu').on('click', function () {
        drawer.open = !drawer.open;
    });

    const activatedClass = 'mdc-list-item--selected';
    $('.mdc-drawer__drawer').on('click', function (event) {
        var target = event.target;
        while (target && !$(target).hasClass('mdc-list-item')) {
            target = target.parentElement;
        }
        if (target) {
            $('.' + activatedClass).removeClass(activatedClass);
            $(event.target).addClass(activatedClass);