Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ampersand-checkbox-view

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-checkbox-view - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

27

ampersand-checkbox-view.js
/*$AMPERSAND_VERSION*/
var View = require('ampersand-view');
var domify = require('domify');
var dom = require('ampersand-dom');
// can be overwritten by anything with:
// <input>, <label> and the same `data-hook` attributes
var template = [
'<label class="checkbox">',
function defaultTemplate() {
return [
'<label class="checkbox">',
'<input type="checkbox"><span data-hook="label"></span>',
'<div data-hook="message-container" class="message message-below message-error">',
'<p data-hook="message-text"></p>',
'<p data-hook="message-text"></p>',
'</div>',
'</label>'
].join('');
'</label>'
].join('');
}
module.exports = View.extend({
template : defaultTemplate,
initialize: function(opts) {

@@ -34,3 +34,3 @@ if (!opts || !opts.name) throw new Error('must pass in a name');

this.autoRender = opts.autoRender;
this.template = opts.template || template;
if (opts.template) this.template = opts.template;
this.beforeSubmit = opts.beforeSubmit || this.beforeSubmit;

@@ -51,8 +51,3 @@

render: function () {
// only allow this to be called once
if (this.rendered) return;
var newDom = domify(this.template);
var parent = this.el && this.el.parentNode;
if (parent) parent.replaceChild(newDom, this.el);
this.el = newDom;
this.renderWithTemplate(this);
this.input = this.el.querySelector('input');

@@ -59,0 +54,0 @@ this.labelEl = this.el.querySelector('[data-hook~=label]');

{
"name": "ampersand-checkbox-view",
"description": "A view module for intelligently rendering and validating checkbox input. Works well with ampersand-form-view.",
"version": "4.0.0",
"version": "4.1.0",
"author": "Henrik Joreteg <henrik@andyet.net>",

@@ -17,4 +17,3 @@ "browserify": {

"ampersand-version": "^1.0.2",
"ampersand-view": "^8.0.0",
"domify": "~1.3.3"
"ampersand-view": "^8.0.0"
},

@@ -21,0 +20,0 @@ "devDependencies": {

@@ -95,2 +95,6 @@ # ampersand-checkbox-view

- 4.1.0
- Remove `domify` and using ampersand-view `renderWithTemplate`
- 4.0.0
- Bump to ampersand-view 8.x
- 3.0.0

@@ -97,0 +101,0 @@ - Extend ampersand-view. Add support `autoRender`, `clear`, `reset`

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc