material-design-lite

Rerendering MDL drawer menu makes drawer button disappear

本小妞迷上赌 提交于 2019-12-08 02:32:26
问题 I'm integrating MDL into a React application. I've just tried to make a component out of a Fixed Header layout (http://www.getmdl.io/components/index.html#layout-section) and noticed that if I hardcode the layout in the html it works as expected. However if i generate that html at runtime with JS the hamburger icon is missing. What should I do to fix that problem? 回答1: When you add an element after dom is already loaded you'll need to 'upgrade' the element. To do so dom-wide, try this snippet

MDL jquery: label overlaps the content into a input field

ぐ巨炮叔叔 提交于 2019-12-07 20:33:21
问题 I use Firefox Version 40.0.3/Chrome 45.0.2454.85 and i have the following problem: The placeholder/label overlaps the content, if i use jQuery. Javascript: $("#eventAddKurzLB").val("test"); HTML: <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <input class="mdl-textfield__input" type="text" id="eventAddKurzLB" /> <label class="mdl-textfield__label" for="eventAddKurzLB">Kurzbezeichnung:</label> <span class="mdl-textfield__error">Es sind nur Zahlen, Buchstaben und

Call a function when tab selected in material design light

北战南征 提交于 2019-12-07 10:26:18
问题 I have three tabs on the page. <!-- Tabs --> <div class="mdl-layout__tab-bar"> <a href="#plots-tab" class="mdl-layout__tab is-active"">Plots</a> <a href="#plots-data-tab" class="mdl-layout__tab">Plots data</a> <a href="#report-tab" class="mdl-layout__tab">Report</a> </div> I need to re-draw plots when Plots tab is selected. I've tried to onclick="redraw_plots();" to the Plots tab, but function is called too fast before tab is activated. Any way to get an event when this tab activates? Thank

Why should I start using Google Material Design Lite instead of Twitter Bootstrap or Foundation

跟風遠走 提交于 2019-12-06 22:54:20
问题 Disclaimer: I don't want to start any fight against Google Fanboys . I'm just asking because I didn't find a direct answer to my question and maybe someone who already started working with it (or any googledev) can give advice. Google recently announced Material Design Lite 1.0 and the project has been starred over 9k times on Github in a few days. I read some posts [1, 2] comparing MDL vs Twitter Bootstrap and I don't understand why anyone outside Google's headquarters should consider start

MDL jquery: label overlaps the content into a input field

别等时光非礼了梦想. 提交于 2019-12-06 08:57:54
I use Firefox Version 40.0.3/Chrome 45.0.2454.85 and i have the following problem: The placeholder/label overlaps the content, if i use jQuery. Javascript: $("#eventAddKurzLB").val("test"); HTML: <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <input class="mdl-textfield__input" type="text" id="eventAddKurzLB" /> <label class="mdl-textfield__label" for="eventAddKurzLB">Kurzbezeichnung:</label> <span class="mdl-textfield__error">Es sind nur Zahlen, Buchstaben und Bindestriche erlaubt!</span> </div> Example: Live-Example: https://jsfiddle.net/vutLb9ut/2/ The problem

Rerendering MDL drawer menu makes drawer button disappear

老子叫甜甜 提交于 2019-12-06 06:24:48
I'm integrating MDL into a React application. I've just tried to make a component out of a Fixed Header layout ( http://www.getmdl.io/components/index.html#layout-section ) and noticed that if I hardcode the layout in the html it works as expected. However if i generate that html at runtime with JS the hamburger icon is missing. What should I do to fix that problem? When you add an element after dom is already loaded you'll need to 'upgrade' the element. To do so dom-wide, try this snippet componentHandler.upgradeDom(); exact issue from the mdlhut I have a similar problem. It seems that in

google MDL textfield focus to change color

╄→尐↘猪︶ㄣ 提交于 2019-12-06 06:10:18
I just getting started this google material design lite. And i found this textfield floating when you r focusing in this label. the color is blue or navy or idk. the problem is, I changed the link color into this color indigo-pink <link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css"> but there is no change for my textfield into an indigo color or a pink color when I focused on it. question is simple, how to change it? I did something with this, but still have no luck in it. the HTML: <form action="#"> <div class="mdl-textfield mdl-js-textfield mdl-textfield-

How to bind knockout checkbox to a material design lite?

て烟熏妆下的殇ゞ 提交于 2019-12-06 04:08:11
I am having problems in bind a Knockout array with Material Design Lite checkbox. Basically it doesn't show the checkbox checked. How can that be fixed? var ViewModel = function() { this.uniqueTabsNames = ko.observableArray(['one', 'two', 'three']); } ko.applyBindings(new ViewModel()); <link href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en" rel="stylesheet" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/material-design-lite/1.3.0/material.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs

How to solely upgrade an element and all its children

∥☆過路亽.° 提交于 2019-12-06 03:39:50
Using componentHandler.upgradeAllRegistered(); upgrades all matching elements within the DOM, which is an unnecessary performance cost in my case: When I insert an element in the DOM, anything from parent to root does not need to be re-upgraded. Only the element and its children are newly created elements and need re-initialization. How can I achieve this functionality? Some insides: https://github.com/google/material-design-lite/issues/871 componentHandler.upgradeElements(node) Where the node variable is the element (and children) you wish to upgrade. 来源: https://stackoverflow.com/questions

Material Design Lite hamburger menu not centered in header

我是研究僧i 提交于 2019-12-06 03:18:02
问题 I'm copying code directly from getmdl.io (the component page) and on all devices (multiple PCs, browsers, phones, etc) the hamburger menu is not centered in the header. I can't seem to isolate the menu icon in the css to realign it. All the component code on getmdl.io has the burger icon displayed correctly. Here is an example image. (I don't have enough reputation to directly link to the image.) http://i.imgur.com/e9HiCP5.jpg here is the code in question http://pastebin.com/Wgdt71Mv 回答1: