Skip to content

Commit

Permalink
правки 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ssftvyn committed Jun 9, 2024
1 parent b92cbfc commit 33486d4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 210 deletions.
74 changes: 0 additions & 74 deletions src/const.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,3 @@
// export const TYPES = ['taxi', 'bus', 'train', 'ship', 'drive', 'flight', 'check-in', 'sightseeing', 'restaurant'];

// export const OFFERS = [
// 'Add luggage',
// 'Switch to comfort class',
// 'Add meal',
// 'Choose seats',
// 'Add a child safety seat'
// ];

// export const CITIES = ['Magnolia', 'Greed Island', 'Soul Society', 'Amestris', 'Death City', 'Karakura', 'Z-City', 'Alubarna', 'Aincrad'];

// export const DESCRIPTIONS = [
// 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
// 'Maecenas dapibus sed enim in ultrices.',
// 'Praesent non ex turpis.',
// 'Nunc mollis sed tortor a faucibus.',
// 'Morbi ac convallis erat, vel volutpat nisl.',
// 'Phasellus a interdum lacus. Aenean consectetur magna vel diam fringilla, at commodo sem placerat.',
// 'Etiam a pellentesque massa.',
// 'Sed sed nisi sed augue convallis suscipit in sed felis.',
// 'Aliquam erat volutpat.'
// ];

// export const Duration = {
// MIN: 60,
// HOUR: 10,
// DAY: 3
// };

// export const DateFormat = {
// LONG: 'YYYY-MM-DDTHH:mm',
// SHORT: 'MMM DD'
// };

// export const Price = {
// MIN: 0,
// MAX: 1000
// };

// export const MILLISECONDS_IN_DAY = 86400000;

// export const MILLISECONDS_IN_HOUR = 3600000;

// export const Mode = {
// DEFAULT: 'DEFAULT',
// EDITING: 'EDITING'
// };

// export const UserAction = {
// UPDATE_POINT: 'UPDATE_POINT',
// ADD_POINT: 'ADD_POINT',
// DELETE_POINT: 'DELETE_POINT'
// };

// export const UpdateType = {
// PATCH: 'PATCH',
// MAJOR: 'MAJOR',
// INIT: 'INIT'
// };

// export const POINT_COUNT_PER_STEP = 7;

// export const ApiServiceMethod = {
// GET: 'GET',
// PUT: 'PUT',
// POST: 'POST',
// DELETE: 'DELETE'
// };

// export const TimeLimit = {
// LOWER_LIMIT: 350,
// UPPER_LIMIT: 1000,
// };
export const TYPES = ['taxi', 'bus', 'train', 'ship', 'drive', 'flight', 'check-in', 'sightseeing', 'restaurant'];

export const FilterType = {
Expand Down
2 changes: 1 addition & 1 deletion src/model/point-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class PointModel extends Observable{
const points = await this.#pointsApiService.points;
this.#points = points.map(this.#adaptToClient);
} catch (error){
this.#points = null;
this.#points = [];
}
this._notify(UpdateType.INIT);
}
Expand Down
1 change: 0 additions & 1 deletion src/presenter/point-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export default class PointPresenter{
UserAction.UPDATE_POINT,
UpdateType.MINOR,
update);
// this.#editPointComponent.reset(update);
};

#handleDeleteClick = (point) => {
Expand Down
10 changes: 9 additions & 1 deletion src/view/edit-point-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,17 @@ export default class EditingPointView extends AbstractStatefulView{

#changeDestinationHandler = (event) => {
event.preventDefault();
const destination = this.#destinations.find((dest) => dest.name === event.target.value);
const inputDestinationName = event.target.value;
const destination = this.#destinations.find((dest) => dest.name === inputDestinationName);

if (!destination) {
event.target.value = this._state.destination.name;
return;
}

this.updateElement({
destination: destination.id,
destinationData: destination
});
};

Expand Down
133 changes: 0 additions & 133 deletions src/view/new-point-view.js

This file was deleted.

0 comments on commit 33486d4

Please sign in to comment.