mirror of https://github.com/rancher/ui.git
39 lines
701 B
JavaScript
39 lines
701 B
JavaScript
import { set } from '@ember/object';
|
|
import Component from '@ember/component';
|
|
import layout from './template';
|
|
import { next } from '@ember/runloop';
|
|
import $ from 'jquery';
|
|
|
|
export default Component.extend({
|
|
layout,
|
|
|
|
showEdit: false,
|
|
|
|
min: '1',
|
|
max: '65535',
|
|
value: null,
|
|
standardKey: 'generic.random',
|
|
placeholder: null,
|
|
|
|
init() {
|
|
this._super(...arguments);
|
|
if (this.value) {
|
|
set(this, 'showEdit', true);
|
|
}
|
|
},
|
|
|
|
actions: {
|
|
showEdit() {
|
|
set(this, 'showEdit', true);
|
|
|
|
next(() => {
|
|
if (this.isDestroyed || this.isDestroying) {
|
|
return;
|
|
}
|
|
|
|
$('INPUT').last()[0].focus();
|
|
});
|
|
}
|
|
}
|
|
});
|