@braintree/class-list

WebJar for @braintree/class-list

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

braintree__class-list
Последняя версия

Последняя версия

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

@braintree/class-list
WebJar for @braintree/class-list
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/braintree/class-list

Скачать braintree__class-list

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/braintree__class-list/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>braintree__class-list</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/braintree__class-list/
implementation 'org.webjars.npm:braintree__class-list:0.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/braintree__class-list/
implementation ("org.webjars.npm:braintree__class-list:0.1.0")
'org.webjars.npm:braintree__class-list:jar:0.1.0'
<dependency org="org.webjars.npm" name="braintree__class-list" rev="0.1.0">
  <artifact name="braintree__class-list" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='braintree__class-list', version='0.1.0')
)
libraryDependencies += "org.webjars.npm" % "braintree__class-list" % "0.1.0"
[org.webjars.npm/braintree__class-list "0.1.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

classList

A helper module for adding and removing classes from DOM nodes in browsers that do not natively support the classList property on DOM nodes.

Installation

npm

npm install --save @braintree/class-list

This module uses commonjs. You must use a build tool such as Browserify or Webpack to include it in your frontend project.

Usage

var classList = require("@braintree/class-list");

add

Adds a class to specified DOM node.

var element = document.querySelector("#id");

element.className = "some-class";

classList.add(element, "any", "number", "of", "classes", "to", "add");

element.className === "some-class any number of classes to add";

remove

Removes a class to specified DOM node.

var element = document.querySelector("#id");

element.className = "some-class some-other-class another-class";

classList.remove(element, "some-class", "another-class");

element.className === "some-other-class";

toggle

Toggles a class to specified DOM node. The first argument is the DOM node, the second is the class to toggle, and the third argument is a boolean for whether to add the class or remove it.

var element = document.querySelector("#id");
var shouldAdd = function (className) {
  return element.className.indexOf(className) === -1;
};

element.className = "some-class some-other-class";

classList.toggle(element, "some-class", shouldAdd("some-class"));

element.className === "some-other-class";

classList.toggle(element, "some-class", shouldAdd("some-class"));

element.className === "some-class some-other-class";

Tests

npm test
org.webjars.npm

Braintree

Версии библиотеки

Версия
0.1.0