-
Notifications
You must be signed in to change notification settings - Fork 286
/
organization_edit.js
46 lines (41 loc) · 1.87 KB
/
organization_edit.js
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
38
39
40
41
42
43
44
45
46
/**
Copyright 2013 Red Hat, Inc.
This software is licensed to you under the GNU General Public
License as published by the Free Software Foundation; either version
2 of the License (GPLv2) or (at your option) any later version.
There is NO WARRANTY for this software, express or implied,
including the implied warranties of MERCHANTABILITY,
NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
have received a copy of GPLv2 along with this software; if not, see
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*/
$(document).ready(function() {
// Auto-heal with service level used in systems/_subscriptions.html.haml
$('.edit_select_org_servicelevel').each(function(){
var common_settings = {
method : 'PUT',
cancel : i18n.cancel,
submit : i18n.save,
indicator : i18n.saving,
tooltip : i18n.clickToEdit,
placeholder : i18n.orgSelectAutoheal,
submitdata : $.extend({ authenticity_token: AUTH_TOKEN }, KT.common.getSearchParams()),
onerror : function(settings, original, xhr) {
original.reset();
$("#notification").replaceWith(xhr.responseText);
notices.checkNotices();
}
};
var element = $(this),
settings = {
type : 'select',
name : element.attr('name'),
data : element.data('options'),
onsuccess : function(result, status, xhr){
element.select(xhr.responseText);
notices.checkNotices();
}
};
$(this).editable($(this).attr('data-url'), $.extend(common_settings, settings));
});
});