mirror of https://gitee.com/bigwinds/arangodb
Fixed indention
This commit is contained in:
parent
fa459bd603
commit
f7a29e6c1d
|
@ -2,92 +2,92 @@
|
||||||
/*jshint unused: false */
|
/*jshint unused: false */
|
||||||
/*global Backbone, templateEngine, $, window*/
|
/*global Backbone, templateEngine, $, window*/
|
||||||
(function () {
|
(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
window.StatisticBarView = Backbone.View.extend({
|
window.StatisticBarView = Backbone.View.extend({
|
||||||
el: '#statisticBar',
|
el: '#statisticBar',
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
"change #arangoCollectionSelect": "navigateBySelect",
|
"change #arangoCollectionSelect": "navigateBySelect",
|
||||||
"click .tab": "navigateByTab"
|
"click .tab": "navigateByTab"
|
||||||
},
|
},
|
||||||
|
|
||||||
template: templateEngine.createTemplate("statisticBarView.ejs"),
|
template: templateEngine.createTemplate("statisticBarView.ejs"),
|
||||||
|
|
||||||
initialize : function () {
|
initialize : function () {
|
||||||
this.currentDB = this.options.currentDB;
|
this.currentDB = this.options.currentDB;
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
$(this.el).html(this.template.render({
|
$(this.el).html(this.template.render({
|
||||||
isSystem: this.currentDB.get("isSystem")
|
isSystem: this.currentDB.get("isSystem")
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$('img.svg').each(function(){
|
$('img.svg').each(function(){
|
||||||
var $img = $(this);
|
var $img = $(this);
|
||||||
var imgID = $img.attr('id');
|
var imgID = $img.attr('id');
|
||||||
var imgClass = $img.attr('class');
|
var imgClass = $img.attr('class');
|
||||||
var imgURL = $img.attr('src');
|
var imgURL = $img.attr('src');
|
||||||
|
|
||||||
$.get(imgURL, function(data) {
|
$.get(imgURL, function(data) {
|
||||||
// Get the SVG tag, ignore the rest
|
// Get the SVG tag, ignore the rest
|
||||||
var $svg = $(data).find('svg');
|
var $svg = $(data).find('svg');
|
||||||
|
|
||||||
// Add replaced image's ID to the new SVG
|
// Add replaced image's ID to the new SVG
|
||||||
if(imgID === undefined) {
|
if(imgID === undefined) {
|
||||||
$svg = $svg.attr('id', imgID);
|
$svg = $svg.attr('id', imgID);
|
||||||
}
|
}
|
||||||
// Add replaced image's classes to the new SVG
|
// Add replaced image's classes to the new SVG
|
||||||
if(imgClass === undefined) {
|
if(imgClass === undefined) {
|
||||||
$svg = $svg.attr('class', imgClass+' replaced-svg');
|
$svg = $svg.attr('class', imgClass+' replaced-svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove any invalid XML tags as per http://validator.w3.org
|
// Remove any invalid XML tags as per http://validator.w3.org
|
||||||
$svg = $svg.removeAttr('xmlns:a');
|
$svg = $svg.removeAttr('xmlns:a');
|
||||||
|
|
||||||
// Replace image with new SVG
|
// Replace image with new SVG
|
||||||
$img.replaceWith($svg);
|
$img.replaceWith($svg);
|
||||||
|
|
||||||
}, 'xml');
|
}, 'xml');
|
||||||
|
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
navigateBySelect: function () {
|
navigateBySelect: function () {
|
||||||
var navigateTo = $("#arangoCollectionSelect").find("option:selected").val();
|
var navigateTo = $("#arangoCollectionSelect").find("option:selected").val();
|
||||||
window.App.navigate(navigateTo, {trigger: true});
|
window.App.navigate(navigateTo, {trigger: true});
|
||||||
},
|
},
|
||||||
|
|
||||||
navigateByTab: function (e) {
|
navigateByTab: function (e) {
|
||||||
var tab = e.target || e.srcElement;
|
var tab = e.target || e.srcElement;
|
||||||
var navigateTo = tab.id;
|
var navigateTo = tab.id;
|
||||||
if (navigateTo === "links") {
|
if (navigateTo === "links") {
|
||||||
$("#link_dropdown").slideToggle(200);
|
$("#link_dropdown").slideToggle(200);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (navigateTo === "tools") {
|
if (navigateTo === "tools") {
|
||||||
$("#tools_dropdown").slideToggle(200);
|
$("#tools_dropdown").slideToggle(200);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.App.navigate(navigateTo, {trigger: true});
|
window.App.navigate(navigateTo, {trigger: true});
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
},
|
},
|
||||||
handleSelectNavigation: function () {
|
handleSelectNavigation: function () {
|
||||||
$("#arangoCollectionSelect").change(function () {
|
$("#arangoCollectionSelect").change(function () {
|
||||||
var navigateTo = $(this).find("option:selected").val();
|
var navigateTo = $(this).find("option:selected").val();
|
||||||
window.App.navigate(navigateTo, {trigger: true});
|
window.App.navigate(navigateTo, {trigger: true});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
selectMenuItem: function (menuItem) {
|
selectMenuItem: function (menuItem) {
|
||||||
$('.navlist li').removeClass('active');
|
$('.navlist li').removeClass('active');
|
||||||
if (menuItem) {
|
if (menuItem) {
|
||||||
$('.' + menuItem).addClass('active');
|
$('.' + menuItem).addClass('active');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
Loading…
Reference in New Issue