Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1025947
D58.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jun 13, 5:23 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Sat, Jun 14, 5:23 PM (3 h, 54 m)
Engine
blob
Format
Raw Data
Handle
661403
Attached To
D58: INP-1418 - Wrap custom toolbar button HTML with markup that allows showing/hiding
D58.id.diff
View Options
Index: branches/5.2.x/core/admin_templates/js/toolbar.js
===================================================================
--- branches/5.2.x/core/admin_templates/js/toolbar.js
+++ branches/5.2.x/core/admin_templates/js/toolbar.js
@@ -264,19 +264,30 @@
/* ----------- */
-function ToolBarMarkup(title, html) //extends ToolBarButton
+function ToolBarMarkup(title, html, $hidden) //extends ToolBarButton
{
this.Title = title;
+ this.Hidden = $hidden ? true : false;
this.HTML = html;
}
ToolBarMarkup.prototype = new ToolBarButton;
ToolBarMarkup.prototype.GetHTML = function() {
- return this.HTML;
+ var add_style = this.ToolBar.ButtonStyle ? 'style="' + this.ToolBar.ButtonStyle + '"' : '';
+ var padding = this.ToolBar.UseLabels ? '12px' : '2px';
+
+ return '<div id="' + this.GetToolID('div') + '" class="toolbar-button" style="padding-top: ' + padding + '; height: 32px;" ' + add_style + '>' + this.HTML + '</div>';
+}
+
+ToolBarMarkup.prototype.Init = function() {
+ this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false;
+
+ if (this.Hidden) {
+ this.Hide();
+ }
}
-ToolBarMarkup.prototype.Init = function() { }
ToolBarMarkup.prototype.Enable = function() { }
ToolBarMarkup.prototype.Disable = function() { }
Event Timeline
Log In to Comment