Skip to content

Commit

Permalink
Revert "Designer: "Add options" dialog doesn't reset when canceling: #…
Browse files Browse the repository at this point in the history
…14110"

This reverts commit b11ff54.
Signed-off-by: Piyush Vijay <piyushvijay.1997@mail.com>
  • Loading branch information
Piyush3079 committed Mar 23, 2018
1 parent b11ff54 commit 72832f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
21 changes: 11 additions & 10 deletions js/designer/move.js
Expand Up @@ -1741,15 +1741,6 @@ function Click_option (id_this, column_name, table_name) {

function Close_option () {
document.getElementById('designer_optionse').style.display = 'none';
document.getElementById('rel_opt').value = '--';
document.getElementById('Query').value = '';
document.getElementById('new_name').value = '';
document.getElementById('operator').value = '---';
document.getElementById('groupby').checked = false;
document.getElementById('h_rel_opt').value = '--';
document.getElementById('h_operator').value = '---';
document.getElementById('having').value = '';
document.getElementById('orderby').value = '---';
}

function Select_all (id_this, owner) {
Expand Down Expand Up @@ -1854,21 +1845,26 @@ function add_object () {
where_obj = new where(rel.value, p.value);// make where object
history_array.push(new history_obj(col_name, where_obj, tab_name, h_tabs[downer + '.' + tab_name], 'Where'));
sum = sum + 1;
rel.value = '--';
p.value = '';
}
if (document.getElementById('new_name').value !== '') {
var rename_obj = new rename(document.getElementById('new_name').value);// make Rename object
history_array.push(new history_obj(col_name, rename_obj, tab_name, h_tabs[downer + '.' + tab_name], 'Rename'));
sum = sum + 1;
document.getElementById('new_name').value = '';
}
if (document.getElementById('operator').value !== '---') {
var aggregate_obj = new aggregate(document.getElementById('operator').value);
history_array.push(new history_obj(col_name, aggregate_obj, tab_name, h_tabs[downer + '.' + tab_name], 'Aggregate'));
sum = sum + 1;
document.getElementById('operator').value = '---';
// make aggregate operator
}
if (document.getElementById('groupby').checked === true) {
history_array.push(new history_obj(col_name, 'GroupBy', tab_name, h_tabs[downer + '.' + tab_name], 'GroupBy'));
sum = sum + 1;
document.getElementById('groupby').checked = false;
// make groupby
}
if (document.getElementById('h_rel_opt').value !== '--') {
Expand All @@ -1877,18 +1873,23 @@ function add_object () {
document.getElementById('designer_hint').style.display = 'block';
return;
}
p = document.getElementById('having');
where_obj = new having(
document.getElementById('h_rel_opt').value,
document.getElementById('having').value,
p.value,
document.getElementById('h_operator').value
);// make where object
history_array.push(new history_obj(col_name, where_obj, tab_name, h_tabs[downer + '.' + tab_name], 'Having'));
sum = sum + 1;
document.getElementById('h_rel_opt').value = '--';
document.getElementById('h_operator').value = '---';
p.value = ''; // make having
}
if (document.getElementById('orderby').value !== '---') {
var oderby_obj = new orderby(document.getElementById('orderby').value);
history_array.push(new history_obj(col_name, oderby_obj, tab_name, h_tabs[downer + '.' + tab_name], 'OrderBy'));
sum = sum + 1;
document.getElementById('orderby').value = '---';
// make orderby
}
PMA_ajaxShowMessage(PMA_sprintf(PMA_messages.strObjectsCreated, sum));
Expand Down
6 changes: 4 additions & 2 deletions templates/database/designer/options_panel.twig
Expand Up @@ -75,7 +75,8 @@
{% trans 'subquery' %}
</td>
<td>
<textarea id="Query" cols="18"></textarea>
<textarea id="Query" cols="18">
</textarea>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -240,7 +241,8 @@
{% trans 'subquery' %}
</td>
<td width="102">
<textarea id="having" cols="18"></textarea>
<textarea id="having" cols="18">
</textarea>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit 72832f3

Please sign in to comment.