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

way2web-clone

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

way2web-clone - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

46

js/clone.core.js

@@ -8,9 +8,10 @@ /**

* @param {object} customEvents
* @param {boolean} customCountOnRemove
*
* @return {object}
*/
window.Clone = function($scope, customElements, customClasses, customEvents) {
window.Clone = function($scope, customElements, customClasses, customEvents, customCountOnRemove) {
'use strict';
var version = '0.1.1';
var version = '0.1.2';

@@ -32,2 +33,4 @@ var elements = {

var countOnRemove = customCountOnRemove;
/**

@@ -89,2 +92,15 @@ * Get all parameters, and merge it with the default values.

/**
* Set the count on remove.
*
* @param {boolean} customCountOnRemove
*
* @return {object}
*/
function setCountOnRemove(customCountOnRemove) {
countOnRemove = customCountOnRemove;
return this;
}
/**

@@ -130,4 +146,13 @@ * Clone the element.

function removeElement() {
var $counter = $scope.find(elements.counter);
var $count = $counter.val();
$(this).closest(elements.removeClone).remove();
if($(elements.removeClone + ':not(.' + classes.hidden + ')') && countOnRemove) {
$count = $($scope).find(elements.removeClone + ':not(.' + classes.hidden + ')').length;
}
$counter.val($count);
triggerEvent('remove', [$(this)]);

@@ -177,11 +202,12 @@ }

return {
init: init,
scope: $scope,
clone: cloneElement,
remove: removeElement,
setElements: setElements,
setClasses: setClasses,
setEvents: setEvents,
version: version
init: init,
scope: $scope,
clone: cloneElement,
remove: removeElement,
setElements: setElements,
setClasses: setClasses,
setEvents: setEvents,
setCountOnRemove: setCountOnRemove,
version: version
};
};
{
"name": "way2web-clone",
"version": "0.1.1",
"version": "0.1.2",
"description": "Clone an element.",

@@ -5,0 +5,0 @@ "files": [

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