Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map name is editable only for new map #754

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions addon/components/flexberry-mapinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ let MapInfoComponent = Ember.Component.extend({
*/
name: null,

/**
Flag: indicates whether name of map can be edited.

@property nameIsEditable
@type Boolean
@default true
*/
nameIsEditable: true,

/**
Map description.

Expand Down Expand Up @@ -217,8 +226,10 @@ let MapInfoComponent = Ember.Component.extend({
let service = this.get('service');
let storageClass = this.get('_storageClassName');
let mapId = this.get('mapId');
let mapIsNew = Ember.isNone(service.getFromStorageSingle(storageClass, mapId));
let dialogVisibility = !Ember.isNone(mapId) && service.getFromStorageSingle(storageClass, mapId) !== false;

this.set('nameIsEditable', !mapIsNew);
this.set('visible', dialogVisibility);
this.set('showOnOpen', dialogVisibility);
},
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/components/flexberry-mapinfo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{flexberry-textbox
class="fluid"
value=name
readonly=true
readonly=nameIsEditable
}}
</div>
<div class="field">
Expand Down