display control elements on one element only; fix title

pull/2927/head
Mihail Maxacov 10 years ago
parent 256e67193d
commit 15dc43c302
  1. 4
      frontend/app/templates/work_packages/inplace_editor/edit_pane.html
  2. 9
      frontend/app/work_packages/directives/inplace_editor/inplace-editor-edit-pane-directive.js
  3. 2
      frontend/app/work_packages/directives/work-package-field-directive.js
  4. 3
      frontend/app/work_packages/services/editable-fields-state.js

@ -1,13 +1,13 @@
<div class="inplace-edit--write edit-strategy-{{ strategy }}" ng-show="fieldController.isEditing">
<form class="inplace-edit--form" ng-if="fieldController.isEditing" name="editPaneController.editForm" ng-submit="editPaneController.submit(false)" novalidate>
<div class="inplace-edit--write-value" ng-include="templateUrl">
<div class="inplace-edit--write-value" ng-include="templateUrl" ng-click="editPaneController.markActive()" tabindex="-1">
</div>
<div class="inplace-edit--dashboard">
<div class="inplace-edit--errors" ng-show="editPaneController.error">
<i class="icon-attention2 inplace-edit--errors--icon"></i>
<div class="inplace-edit--errors--text" ng-bind="editPaneController.error" role="alert" aria-live="polite"></div>
</div>
<div class="inplace-edit--controls" ng-hide="fieldController.state.isBusy">
<div class="inplace-edit--controls" ng-hide="fieldController.state.isBusy || !editPaneController.isActive()">
<accessible-by-keyboard execute="editPaneController.submit(false)" class="inplace-edit--control inplace-edit--control--save">
<icon-wrapper icon-name="yes" icon-title="{{ editPaneController.saveTitle }}">
</icon-wrapper>

@ -105,6 +105,14 @@ module.exports = function(
}
};
this.isActive = function() {
return $scope.fieldController.field === EditableFieldsState.activeField;
};
this.markActive = function() {
EditableFieldsState.activeField = $scope.fieldController.field;
};
this.getPendingFormChanges = getPendingFormChanges;
function getPendingFormChanges() {
@ -143,6 +151,7 @@ module.exports = function(
var inputElement = element.find('.focus-input');
FocusHelper.focus(inputElement);
inputElement.triggerHandler('keyup');
scope.editPaneController.markActive();
});
};

@ -54,7 +54,7 @@ module.exports = function(WorkPackageFieldService, EditableFieldsState) {
this.state.isBusy = false;
this.isEditing = false;
this.updateWriteValue();
this.editTitle = I18n.t('js.inplace.button_edit', { attribute: this.field });
this.editTitle = I18n.t('js.inplace.button_edit', { attribute: this.getLabel() });
}
}

@ -30,6 +30,7 @@ module.exports = function() {
return {
workPackage: null,
errors: null,
isBusy: false
isBusy: false,
activeField: null
};
};

Loading…
Cancel
Save