callumbwhyte / meganav

A flexible, draggable link picker for constructing site navigation menus in Umbraco
MIT License
35 stars 34 forks source link

Update item value via extend to maintain reference to original object #13

Closed SudoCat closed 7 years ago

SudoCat commented 7 years ago

Titles are not being updated when editing an existing menu item. This is due to updating the value via basic assignment, which was breaking the reference to the original object (resulting in a new object being created, but never assigned to the main items array).

Using angular.extend to update the object ensures we replace the original values, instead of the entire object. Now our titles can update

Nav Items were also being automatically updated with any other changes, regardless of whether or not you clicked "select" or "cancel" in the link picker dialog. Changes will now only be applied when you press "select".

SudoCat commented 7 years ago

Original PR was written for the LinkPickerDialog, this has now been updated to use the new dialogDirective.

callumbwhyte commented 7 years ago

Great find, and great fix - thanks for the PR! #h5yr