|
@@ -166,41 +166,37 @@ var buildDropdown = function(pk) {
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
var render = function () {
|
|
var render = function () {
|
|
|
- // <div class="popover fade right in" role="tooltip" style="max-width: 600px; width: 400px; display: block; top: 281.5px; left: 68px;" id="popover623735">
|
|
|
|
|
- // <div class="arrow" style="top: 53.5px;"></div>
|
|
|
|
|
- // <div style="display:block;position:relative;">
|
|
|
|
|
- // <div class="popover-title">Więcej funkcji dla rekordu nr 163</div>
|
|
|
|
|
- // <button type="button" class="close" onclick="return hidePopover();" style="position:absolute;right:8px;top:6px;">×</button>
|
|
|
|
|
- // </div>
|
|
|
|
|
- // <div class="popover-content">
|
|
|
|
|
- // <ul class="list-unstyled popoverRowFunctions">
|
|
|
|
|
- // <li><a href="index.php?_route=TableMsgs&_task=tableRow&idTable=25873&idRow=163" style="margin:0 2px;" title="Wiadomości" class="func_name-msgs"><span class="glyphicon glyphicon-envelope"></span> Wiadomości</a></li>
|
|
|
|
|
- // <li><a href="#HIST/163" style="margin:0 2px;" title="Historia" class="func_name-hist"><span class="glyphicon glyphicon-book"></span> Historia</a></li>
|
|
|
|
|
- // </ul>
|
|
|
|
|
- // <div class="popoverCellContent" style="white-space:normal">
|
|
|
|
|
- // <p class="text-muted">Pobieranie funkcji...</p><p></p>
|
|
|
|
|
- // </div>
|
|
|
|
|
- // </div>
|
|
|
|
|
- // </div>
|
|
|
|
|
var state = store.getState()
|
|
var state = store.getState()
|
|
|
if(DBG)console.log('RX:render()...')
|
|
if(DBG)console.log('RX:render()...')
|
|
|
if (!_dropdownNode) return // throw 'Missing dropdownNode'
|
|
if (!_dropdownNode) return // throw 'Missing dropdownNode'
|
|
|
if (!_btnNode) return // throw 'Missing btnNode'
|
|
if (!_btnNode) return // throw 'Missing btnNode'
|
|
|
ReactDOM.render(
|
|
ReactDOM.render(
|
|
|
h('div', {}, [
|
|
h('div', {}, [
|
|
|
- h('div', { style: { backgroundColor: '#f7f7f7', padding: '8px', borderBottom: '1px solid #ddd' } }, [
|
|
|
|
|
- h('input', { type: 'text',
|
|
|
|
|
- placeholder: 'Szukaj...',
|
|
|
|
|
- className: 'p5UI__dropdown-input input-sm',
|
|
|
|
|
- onChange: function (e) { store.dispatch({ type: 'filter', payload: e.target.value }); },
|
|
|
|
|
- autoFocus: true,
|
|
|
|
|
- value: state.query,
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ h('div', {
|
|
|
|
|
+ style: { backgroundColor: '#f7f7f7', padding: '8px 12px', borderBottom: '1px solid #ddd' },
|
|
|
|
|
+ }, [
|
|
|
|
|
+ h('div', { className: 'form-group', style: { padding: 0, margin: 0 } }, [
|
|
|
|
|
+ h('div', { className: 'input-group', style: { padding: 0, margin: 0 } }, [
|
|
|
|
|
+ h('input', { type: 'text',
|
|
|
|
|
+ placeholder: 'Szukaj...',
|
|
|
|
|
+ className: 'p5UI__dropdown-input form-control input-sm',
|
|
|
|
|
+ onChange: function (e) { store.dispatch({ type: 'filter', payload: e.target.value }); },
|
|
|
|
|
+ autoFocus: true,
|
|
|
|
|
+ value: state.query,
|
|
|
|
|
+ }),
|
|
|
|
|
+ h('span', { className: 'input-group-addon', style: { padding: '6px', backgroundColor: '#fff' } }, [
|
|
|
|
|
+ h('span', { className: 'glyphicon glyphicon-remove hover-gray', style: { cursor: 'pointer' },
|
|
|
|
|
+ title: "wyczyść",
|
|
|
|
|
+ onClick: function (e) { store.dispatch({ type: 'filter', payload: '' }); },
|
|
|
|
|
+ })
|
|
|
|
|
+ ])
|
|
|
|
|
+ ])
|
|
|
|
|
+ ])
|
|
|
]),
|
|
]),
|
|
|
h('div', { style: { backgroundColor: '#fff', padding: '0' } },
|
|
h('div', { style: { backgroundColor: '#fff', padding: '0' } },
|
|
|
state.filter.map(function (inst) {
|
|
state.filter.map(function (inst) {
|
|
|
- return h('div', { className: 'p5UI__dropdown-item', style: {padding: '8px'} }, [
|
|
|
|
|
- _renderReactBtnToggleInstance({ namespace: inst.namespace, store: store }),
|
|
|
|
|
|
|
+ return h('label', { className: 'p5UI__dropdown-item', style: {padding: '8px 12px'} }, [
|
|
|
|
|
+ _renderReactToggleInstance({ namespace: inst.namespace, store: store }),
|
|
|
inst.label,
|
|
inst.label,
|
|
|
])
|
|
])
|
|
|
})
|
|
})
|
|
@@ -210,35 +206,28 @@ var buildDropdown = function(pk) {
|
|
|
);
|
|
);
|
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
|
if (!_dropdownNode) return false
|
|
if (!_dropdownNode) return false
|
|
|
- if (!_dropdownNode.firstChild) return false
|
|
|
|
|
- if (!_dropdownNode.firstChild.firstChild) return false
|
|
|
|
|
- if (!_dropdownNode.firstChild.firstChild.firstChild) return false
|
|
|
|
|
- _dropdownNode.firstChild.firstChild.firstChild.focus()
|
|
|
|
|
|
|
+ var searchNode = _dropdownNode.getElementsByTagName('input')[0]
|
|
|
|
|
+ if (!searchNode) return false
|
|
|
|
|
+ searchNode.focus()
|
|
|
}, 100)
|
|
}, 100)
|
|
|
}
|
|
}
|
|
|
- var _renderReactBtnToggleInstance = function (props) {
|
|
|
|
|
|
|
+ var _renderReactToggleInstance = function (props) {
|
|
|
var state = props.store.getState()
|
|
var state = props.store.getState()
|
|
|
if (-1 === state.item.instances.indexOf(props.namespace)) {
|
|
if (-1 === state.item.instances.indexOf(props.namespace)) {
|
|
|
if (-1 === state.waitingSet.indexOf(props.namespace)) {
|
|
if (-1 === state.waitingSet.indexOf(props.namespace)) {
|
|
|
- return h('button', { style: { margin: '0 6px 0 0' },
|
|
|
|
|
- className: 'btn btn-xs btn-default',
|
|
|
|
|
|
|
+ return h('input', { type: "checkbox", style: { margin: '0 6px 0 0' },
|
|
|
onClick: function () { props.store.dispatch(_reducer_instance_set_send(props.namespace)); }
|
|
onClick: function () { props.store.dispatch(_reducer_instance_set_send(props.namespace)); }
|
|
|
- }, 'ustaw')
|
|
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- return h('button', { style: { margin: '0 6px 0 0' },
|
|
|
|
|
- className: 'btn btn-xs btn-default disabled',
|
|
|
|
|
- }, 'ustaw...')
|
|
|
|
|
|
|
+ return h('input', { type: "checkbox", checked: "checked", disabled: "disabled", style: { margin: '0 6px 0 0' } })
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
if (-1 === state.waitingUnSet.indexOf(props.namespace)) {
|
|
if (-1 === state.waitingUnSet.indexOf(props.namespace)) {
|
|
|
- return h('button', { style: { margin: '0 6px 0 0' },
|
|
|
|
|
- className: 'btn btn-xs btn-default',
|
|
|
|
|
|
|
+ return h('input', { type: "checkbox", checked: "checked", style: { margin: '0 6px 0 0' },
|
|
|
onClick: function () { props.store.dispatch(_reducer_instance_unset_send(props.namespace)); }
|
|
onClick: function () { props.store.dispatch(_reducer_instance_unset_send(props.namespace)); }
|
|
|
- }, 'usuń')
|
|
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- return h('button', { style: { margin: '0 6px 0 0' },
|
|
|
|
|
- className: 'btn btn-xs btn-default disabled',
|
|
|
|
|
- }, 'usuń...')
|
|
|
|
|
|
|
+ return h('input', { type: "checkbox", style: { margin: '0 6px 0 0' } })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|