@@ -23225,11 +23225,6 @@ var ToDoList = function (_React$Component) {
23225
23225
DELETE_LIST_ITEM: 6
23226
23226
};
23227
23227
_this.state = { listItems: [] };
23228
- _this.handleCreateListItem = _this.handleCreateListItem.bind(_this);
23229
- _this.handleCheckEvent = _this.handleCheckEvent.bind(_this);
23230
- _this.handleOpenModal = _this.handleOpenModal.bind(_this);
23231
- _this.handleEditContent = _this.handleEditContent.bind(_this);
23232
- _this.handleDeleteItem = _this.handleDeleteItem.bind(_this);
23233
23228
return _this;
23234
23229
}
23235
23230
@@ -23379,9 +23374,9 @@ var ToDoList = function (_React$Component) {
23379
23374
{
23380
23375
key: item.key, id: item.key, ref: 'list-item-' + item.key,
23381
23376
checked: item.checked,
23382
- checkEvent: _this4.handleCheckEvent,
23383
- openModal: _this4.handleOpenModal,
23384
- editContent: _this4.handleEditContent
23377
+ checkEvent: _this4.handleCheckEvent.bind(_this4) ,
23378
+ openModal: _this4.handleOpenModal.bind(_this4) ,
23379
+ editContent: _this4.handleEditContent.bind(_this4)
23385
23380
},
23386
23381
item.content
23387
23382
);
@@ -23391,14 +23386,14 @@ var ToDoList = function (_React$Component) {
23391
23386
'div',
23392
23387
{ className: 'to-do-app' },
23393
23388
_react2.default.createElement(_ListForm2.default, {
23394
- createListItem: this.handleCreateListItem,
23389
+ createListItem: this.handleCreateListItem.bind(this) ,
23395
23390
ref: 'form'
23396
23391
}),
23397
23392
_react2.default.createElement(_ListModal2.default, {
23398
23393
ref: 'modal',
23399
23394
modalId: this.state.modal ? this.state.modal.id : 0,
23400
23395
modalContent: this.state.modal ? this.state.modal.content : '',
23401
- confirmDelete: this.handleDeleteItem
23396
+ confirmDelete: this.handleDeleteItem.bind(this)
23402
23397
}),
23403
23398
_react2.default.createElement(
23404
23399
'div',
@@ -23447,11 +23442,6 @@ var ListItem = function (_React$Component) {
23447
23442
23448
23443
var _this = _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).call(this, props));
23449
23444
23450
- _this.handleItemCheck = _this.handleItemCheck.bind(_this);
23451
- _this.handleDeleteItemClick = _this.handleDeleteItemClick.bind(_this);
23452
- _this.handleEditContentChange = _this.handleEditContentChange.bind(_this);
23453
- _this.handleEditContent = _this.handleEditContent.bind(_this);
23454
- _this.handleHideEditForm = _this.handleHideEditForm.bind(_this);
23455
23445
_this.state = { content: _this.props.children };
23456
23446
return _this;
23457
23447
}
@@ -23505,7 +23495,7 @@ var ListItem = function (_React$Component) {
23505
23495
id: labelCheckId,
23506
23496
className: "list-item-check",
23507
23497
checked: this.props.checked,
23508
- onChange: this.handleItemCheck
23498
+ onChange: this.handleItemCheck.bind(this)
23509
23499
}),
23510
23500
_react2.default.createElement("input", {
23511
23501
type: "checkbox",
@@ -23526,16 +23516,16 @@ var ListItem = function (_React$Component) {
23526
23516
name: "edit-content",
23527
23517
id: "edit-content",
23528
23518
value: this.state.content,
23529
- onChange: this.handleEditContentChange
23519
+ onChange: this.handleEditContentChange.bind(this)
23530
23520
}),
23531
23521
_react2.default.createElement(
23532
23522
"button",
23533
- { id: "confirm", onClick: this.handleEditContent },
23523
+ { id: "confirm", onClick: this.handleEditContent.bind(this) },
23534
23524
"OK"
23535
23525
),
23536
23526
_react2.default.createElement(
23537
23527
"button",
23538
- { id: "cancel", onClick: this.handleHideEditForm },
23528
+ { id: "cancel", onClick: this.handleHideEditForm.bind(this) },
23539
23529
"Cancel"
23540
23530
)
23541
23531
),
@@ -23566,7 +23556,7 @@ var ListItem = function (_React$Component) {
23566
23556
),
23567
23557
_react2.default.createElement(
23568
23558
"button",
23569
- { id: "delete-btn", onClick: this.handleDeleteItemClick },
23559
+ { id: "delete-btn", onClick: this.handleDeleteItemClick.bind(this) },
23570
23560
_react2.default.createElement("span", null),
23571
23561
_react2.default.createElement("span", null)
23572
23562
)
@@ -23611,10 +23601,7 @@ var ListForm = function (_React$Component) {
23611
23601
function ListForm(props) {
23612
23602
_classCallCheck(this, ListForm);
23613
23603
23614
- var _this = _possibleConstructorReturn(this, (ListForm.__proto__ || Object.getPrototypeOf(ListForm)).call(this, props));
23615
-
23616
- _this.handleCreateListItemEvent = _this.handleCreateListItemEvent.bind(_this);
23617
- return _this;
23604
+ return _possibleConstructorReturn(this, (ListForm.__proto__ || Object.getPrototypeOf(ListForm)).call(this, props));
23618
23605
}
23619
23606
23620
23607
_createClass(ListForm, [{
@@ -23634,7 +23621,7 @@ var ListForm = function (_React$Component) {
23634
23621
_react2.default.createElement('input', { ref: 'item-content', id: 'item-content' }),
23635
23622
_react2.default.createElement(
23636
23623
'button',
23637
- { onClick: this.handleCreateListItemEvent },
23624
+ { onClick: this.handleCreateListItemEvent.bind(this) },
23638
23625
_react2.default.createElement('img', { src: '/icon/plus-sign-light.png', alt: 'plus-sign' })
23639
23626
)
23640
23627
);
@@ -23680,8 +23667,6 @@ var ListModal = function (_React$Component) {
23680
23667
var _this = _possibleConstructorReturn(this, (ListModal.__proto__ || Object.getPrototypeOf(ListModal)).call(this, props));
23681
23668
23682
23669
_this.open = _this.open.bind(_this);
23683
- _this.handleConfirmDelete = _this.handleConfirmDelete.bind(_this);
23684
- _this.handleCloseModal = _this.handleCloseModal.bind(_this);
23685
23670
return _this;
23686
23671
}
23687
23672
@@ -23734,12 +23719,12 @@ var ListModal = function (_React$Component) {
23734
23719
{ className: 'list-modal-btn-group' },
23735
23720
_react2.default.createElement(
23736
23721
'button',
23737
- { id: 'modal-confirm', onClick: this.handleConfirmDelete },
23722
+ { id: 'modal-confirm', onClick: this.handleConfirmDelete.bind(this) },
23738
23723
'Yes'
23739
23724
),
23740
23725
_react2.default.createElement(
23741
23726
'button',
23742
- { id: 'modal-cancel', onClick: this.handleCloseModal },
23727
+ { id: 'modal-cancel', onClick: this.handleCloseModal.bind(this) },
23743
23728
'No'
23744
23729
)
23745
23730
)
0 commit comments