wpml-tm-editor-job-basic-field-view.js
805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*global Backbone, jQuery, _, tmEditor */
var WPML_TM = WPML_TM || {};
(function () {
"use strict";
WPML_TM.editorBasicFieldView = WPML_TM.editorJobFieldView.extend({
events: _.extend({
'input .js-translated-value': 'onChange'
}, WPML_TM.editorJobFieldView.prototype.events),
onChange: function () {
tmEditor.model.trigger('translationUpdated', true);
this.updateUI();
},
getOriginal: function () {
return this.$el.find('.js-original-value').val();
},
getTranslation: function () {
return this.$el.find('.js-translated-value').val();
},
setTranslation: function (value) {
this.$el.find('.js-translated-value').val(value);
this.updateUI();
},
setTranslatedColor: function(css) {
this.$el.find('.js-translated-value').css(css);
}
});
}());