mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
M #~: Separate Foundation update logic (#1042)
Signed-off-by: Frederick Borges <fborges@opennebula.io>
This commit is contained in:
parent
e268031974
commit
8711c79e0c
@ -26,6 +26,7 @@ define(function(require) {
|
||||
var Menu = require("utils/menu");
|
||||
var Tips = require("utils/tips");
|
||||
var Navigo = require("Navigo");
|
||||
var UtilsFoundation = require("utils/foundation/utils");
|
||||
|
||||
var router;
|
||||
|
||||
@ -612,7 +613,7 @@ define(function(require) {
|
||||
|
||||
// Reload foundation ips dropdown when change page on datatables
|
||||
$(document).on("click", ".paginate_button", function() {
|
||||
$('.ips-dropdown').foundation();
|
||||
UtilsFoundation.update(null);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -33,6 +33,8 @@ define(function(require) {
|
||||
var FireedgeValidator = require('utils/fireedge-validator');
|
||||
var Websocket = require("utils/websocket");
|
||||
|
||||
var UtilsFoundation = require("utils/foundation/utils");
|
||||
|
||||
var VMS_TAB_ID = require('tabs/vms-tab/tabId');
|
||||
|
||||
/*
|
||||
@ -244,7 +246,7 @@ define(function(require) {
|
||||
$.when.apply($, promises).then(function() {
|
||||
if (that.serviceroleVMsDataTable) {
|
||||
that.serviceroleVMsDataTable.updateView(null, roleVms, true);
|
||||
$(".rdp-buttons", context).foundation();
|
||||
UtilsFoundation.update(context);
|
||||
VMRemoteActions.bindActionsToContext(context)
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ define(function(require) {
|
||||
var FireedgeValidator = require("utils/fireedge-validator");
|
||||
var Websocket = require("utils/websocket");
|
||||
var VMRemoteActions = require("utils/remote-actions");
|
||||
var UtilsFoundation = require("utils/foundation/utils");
|
||||
|
||||
/*
|
||||
CONSTANTS
|
||||
@ -169,7 +170,7 @@ define(function(require) {
|
||||
|
||||
VMsTableUtils.tooltipCharters();
|
||||
|
||||
$(".rdp-buttons").foundation();
|
||||
UtilsFoundation.update(null);
|
||||
|
||||
FireedgeValidator.validateFireedgeToken(function(token) {
|
||||
if (Websocket.disconnected()) {
|
||||
|
29
src/sunstone/public/app/utils/foundation/utils.js
Normal file
29
src/sunstone/public/app/utils/foundation/utils.js
Normal file
@ -0,0 +1,29 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2021, OpenNebula Project, OpenNebula Systems */
|
||||
/* */
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
||||
/* not use this file except in compliance with the License. You may obtain */
|
||||
/* a copy of the License at */
|
||||
/* */
|
||||
/* http://www.apache.org/licenses/LICENSE-2.0 */
|
||||
/* */
|
||||
/* Unless required by applicable law or agreed to in writing, software */
|
||||
/* distributed under the License is distributed on an "AS IS" BASIS, */
|
||||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
||||
/* See the License for the specific language governing permissions and */
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function(require) {
|
||||
require('foundation')
|
||||
|
||||
function _update(context) {
|
||||
$('.ips-dropdown', context).foundation();
|
||||
$('.rdp-buttons', context).foundation();
|
||||
}
|
||||
|
||||
return {
|
||||
'update': _update
|
||||
}
|
||||
|
||||
});
|
@ -19,13 +19,14 @@ define(function(require) {
|
||||
|
||||
var OpenNebulaVM = require('opennebula/vm');
|
||||
var OpenNebulaService = require('opennebula/service');
|
||||
var UtilsFoundation = require("utils/foundation/utils");
|
||||
|
||||
var TemplateInfo = require('hbs!./info');
|
||||
|
||||
function printInfoConnection(context, info) {
|
||||
context.empty()
|
||||
info && context.append(TemplateInfo(info))
|
||||
$('.ips-dropdown').foundation()
|
||||
UtilsFoundation.update(context);
|
||||
}
|
||||
|
||||
function decodeInfoConnection(info_encode) {
|
||||
|
@ -24,6 +24,7 @@ define(function (require) {
|
||||
var Notifier = require('utils/notifier');
|
||||
var TemplateUtils = require('utils/template-utils');
|
||||
var OpenNebulaUser = require('opennebula/user');
|
||||
var UtilsFoundation = require("utils/foundation/utils");
|
||||
|
||||
var LABELS_ATTR = 'LABELS';
|
||||
|
||||
@ -492,6 +493,7 @@ define(function (require) {
|
||||
|
||||
dataTable.data("sunstone-label-filter", label);
|
||||
dataTable.fnFilter(regExp, labelsColumn, true, false);
|
||||
UtilsFoundation.update(null);
|
||||
}
|
||||
|
||||
function _clearLabelsFilter(dataTable, labelsColumn) {
|
||||
|
@ -30,6 +30,7 @@ define(function(require) {
|
||||
var Notifier = require('utils/notifier');
|
||||
var OpenNebulaUser = require('opennebula/user');
|
||||
var LabelsUtils = require('utils/labels/utils');
|
||||
var UtilsFoundation = require("utils/foundation/utils");
|
||||
|
||||
/*
|
||||
TEMPLATES
|
||||
@ -214,7 +215,7 @@ define(function(require) {
|
||||
|
||||
$('#' + this.dataTableId + 'Search').on('input', function() {
|
||||
that.dataTable.fnFilter($(this).val());
|
||||
$(".ips-dropdown").foundation();
|
||||
UtilsFoundation.update(null);
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -699,7 +700,7 @@ define(function(require) {
|
||||
|
||||
if (that.postUpdateView) {
|
||||
that.postUpdateView();
|
||||
$(".ips-dropdown").foundation();
|
||||
UtilsFoundation.update(null);
|
||||
}
|
||||
|
||||
if(that.conf.searchDropdownHTML != undefined){
|
||||
@ -741,7 +742,7 @@ define(function(require) {
|
||||
}
|
||||
});
|
||||
|
||||
$(".ips-dropdown").foundation();
|
||||
UtilsFoundation.update(null);
|
||||
}
|
||||
|
||||
function _getElementData(id, resource_tag) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user