think-demo-task-list
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -10,5 +10,6 @@ { | ||
"Task 3" | ||
] | ||
], | ||
"inputId": "new-task" | ||
} | ||
} |
@@ -8,10 +8,11 @@ /* eslint complexity: 'off' */ | ||
var taskList = function () { | ||
var $taskList = $('[data-component="task-list"]'); | ||
var $newTask = $('#new-task'); | ||
var addTask = function addTask() { | ||
var newTask = $newTask.val(); | ||
var addTask = function addTask(e) { | ||
var $addTaskButton = $(e.target); | ||
var $taskList = $addTaskButton.parent().siblings('.tbk-task-list'); | ||
var $newTask = $addTaskButton.siblings('input'); | ||
var newTaskText = $newTask.val(); | ||
if (newTask !== '') { | ||
var newTaskHtml = '<li class="tbk-task-list-item">' + newTask + '</li>'; | ||
if (newTaskText !== '') { | ||
var newTaskHtml = '<li class="tbk-task-list-item">' + newTaskText + '</li>'; | ||
$($taskList[0]).append(newTaskHtml); | ||
@@ -18,0 +19,0 @@ } |
@@ -7,10 +7,11 @@ /* eslint complexity: 'off' */ | ||
var taskList = (function() { | ||
var $taskList = $('[data-component="task-list"]'); | ||
var $newTask = $('#new-task'); | ||
var addTask = function () { | ||
var newTask = $newTask.val(); | ||
var addTask = function (e) { | ||
var $addTaskButton = $(e.target); | ||
var $taskList = $addTaskButton.parent().siblings('.tbk-task-list'); | ||
var $newTask = $addTaskButton.siblings('input'); | ||
var newTaskText = $newTask.val(); | ||
if (newTask !== '') { | ||
var newTaskHtml = `<li class="tbk-task-list-item">${newTask}</li>`; | ||
if (newTaskText !== '') { | ||
var newTaskHtml = `<li class="tbk-task-list-item">${newTaskText}</li>`; | ||
$($taskList[0]).append(newTaskHtml); | ||
@@ -17,0 +18,0 @@ } |
{ | ||
"name": "think-demo-task-list", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "This is a sample task list component built specifically to demonstrate the use of Lerna in a Think Company Build Kit", | ||
@@ -5,0 +5,0 @@ "main": "dist/index", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12027
290