Commit c370fc55 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '962-sort-submaps-in-left-panel-by-name' into 'master'

Resolve "Sort submaps in left panel by name"

Closes #962

See merge request minerva/core!985
parents 46e2d813 2bdd3819
...@@ -6,6 +6,7 @@ minerva (15.0.0~alpha.0) stable; urgency=medium ...@@ -6,6 +6,7 @@ minerva (15.0.0~alpha.0) stable; urgency=medium
overlays contain proper warning (#809) overlays contain proper warning (#809)
* Small improvement: CellDesigner text area object can have "BorderColor" * Small improvement: CellDesigner text area object can have "BorderColor"
property defined (#806) property defined (#806)
* Small improvement: list of submaps is sorted alphabetically (#962)
* Bug fix: position of structural state is preserved on upload CellDesigner * Bug fix: position of structural state is preserved on upload CellDesigner
file (#671) file (#671)
* Bug fix: problematic notes doesn't crash CellDesigner upload (#968) * Bug fix: problematic notes doesn't crash CellDesigner upload (#968)
......
...@@ -24,9 +24,9 @@ var Functions = require('../../Functions'); ...@@ -24,9 +24,9 @@ var Functions = require('../../Functions');
* @extends Panel * @extends Panel
*/ */
function SubmapPanel(params) { function SubmapPanel(params) {
params.panelName = "submap"; params["panelName"] = "submap";
params.scrollable = true; params["scrollable"] = true;
params.helpTip = "The Submaps tab summarizes all the submap networks uploaded together and linked to the main network of <b>'" params["helpTip"] = "The Submaps tab summarizes all the submap networks uploaded together and linked to the main network of <b>'"
+ params.parent.getMap().getProject().getName() + "'</b> project."; + params.parent.getMap().getProject().getName() + "'</b> project.";
Panel.call(this, params); Panel.call(this, params);
$(params.element).addClass("minerva-submap-panel"); $(params.element).addClass("minerva-submap-panel");
...@@ -187,6 +187,15 @@ SubmapPanel.prototype.init = function () { ...@@ -187,6 +187,15 @@ SubmapPanel.prototype.init = function () {
if (type === "UNKNOWN") { if (type === "UNKNOWN") {
tableName = "" tableName = ""
} }
modelsByType[type].sort(function (modelA, modelB) {
if (modelA.getName() > modelB.getName()) {
return 1;
}
if (modelA.getName() < modelB.getName()) {
return -1;
}
return 0;
});
div.appendChild(self.createTable(modelsByType[type], tableName)); div.appendChild(self.createTable(modelsByType[type], tableName));
} }
if (models.length <= 1) { if (models.length <= 1) {
......
...@@ -985,7 +985,7 @@ MapModel.prototype.setCreationDate = function (creationDate) { ...@@ -985,7 +985,7 @@ MapModel.prototype.setCreationDate = function (creationDate) {
/** /**
* *
* @returns {string|null} * @returns {?null|string}
*/ */
MapModel.prototype.getDescription = function () { MapModel.prototype.getDescription = function () {
return this._description; return this._description;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment