Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Pass resize_events to AjxpPane
Browse files Browse the repository at this point in the history
Pass menuOffsetLeft/Top to UserWidget
  • Loading branch information
cdujeu committed Jul 14, 2014
1 parent b74fd00 commit 978e7a6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/access.fs/fsTemplatePart.xml
Expand Up @@ -4,7 +4,7 @@
<template_part ajxpClass="AjxpPane" ajxpId="orbit_content" ajxpOptions="{}" theme="orbit"><![CDATA[
<div id="workspace_toolbar" ajxpClass="AjxpPane" class="skipSibling">
<div id="repo_chooser" style="width:15px;" ajxpClass="RepositorySelect" ajxpOptions='{"menuPosition": "bottom middle", "menuOffsetTop":5, "menuOffsetLeft":116, "menuEvent":"over", "simpleLabel":"<span class=\"icon-caret-down\"></span>"}'></div>
<div id="breadcrumb" class="breadcrumbs-one" ajxpClass="Breadcrumb" ajxpOptions='{"use_ul":true, "always_show_root":true, "hide_home_icon":true, "flexTo":"workspace_toolbar", "flexToMargin":80, "checkSiblings":true}'></div>
<div id="breadcrumb" class="breadcrumbs-one" ajxpClass="Breadcrumb" ajxpOptions='{"use_ul":true, "always_show_root":true, "hide_home_icon":true, "flexTo":"workspace_toolbar", "flexToMargin":80, "checkSiblings":true, "resize_events":["actions_refreshed"]}'></div>
<div style="float:right;margin-top:14px;" ajxpClass="AjxpPane" ajxpOptions='{}' id="search_engine_cont">
<div id="buttons_bar_top" style="float:right;" class="action_bar" ajxpClass="ActionsToolbar" ajxpOptions='{"toolbarsList":["put"],"skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":2}'></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/manifest.xml
Expand Up @@ -237,7 +237,7 @@
<div id="background-imager" ajxpClass="AjxpPane" ajxpOptions='{"fit":"height","imageBackgroundFromConfigs":"gui.ajax/WELCOME_PAGE_BACKGROUND_"}'>
<div id="global_toolbar" ajxpClass="LogoWidget">
<div id="clickable_home" title="Home"></div>
<div id="logging_string" ajxpClass="UserWidget" ajxpOptions='{"menuEvent" : "over"}'></div>
<div id="logging_string" ajxpClass="UserWidget" ajxpOptions='{"menuEvent" : "over","menuOffsetLeft":11,"menuOffsetTop":11}'></div>
</div>
<div id="orbit_content" ajxpClass="AjxpPane" ajxpOptions='{"fit":"height"}'></div>
</div>
Expand Down
14 changes: 14 additions & 0 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.AjxpPane.js
Expand Up @@ -58,6 +58,15 @@ Class.create("AjxpPane", {

}
}
if(this.options.resize_events){
this.resizeEvents = $H();
this.options.resize_events.each(function(eventName){
var binder = this.resize.bind(this);
this.resizeEvents.set("ajaxplorer:" + eventName, binder);
document.observe("ajaxplorer:" + eventName, binder);
}.bind(this) );
}

if(this.options.messageBoxReference && ajaxplorer){
ajaxplorer.registerAsMessageBoxReference(this.htmlElement);
}
Expand Down Expand Up @@ -176,6 +185,11 @@ Class.create("AjxpPane", {
document.stopObserving(pair.key, pair.value);
});
}
if(this.resizeEvents){
this.resizeEvents.each(function(pair){
document.stopObserving(pair.key, pair.value);
});
}
},

/**
Expand Down
Expand Up @@ -149,8 +149,8 @@ Class.create("UserWidget", {
position: 'bottom right',
anchor:this.element,
createAnchor:false,
topOffset:2,
leftOffset:-3,
topOffset: (this.options.menuOffsetTop ? this.options.menuOffsetTop : 2),
leftOffset:(this.options.menuOffsetLeft? this.options.menuOffsetLeft :-3),
menuItems: menuItems,
menuTitle: MessageHash[511].replace('%s', ajaxplorer.getPluginConfigs("ajaxplorer").get("APPLICATION_TITLE")),
detailedItems: true,
Expand Down

0 comments on commit 978e7a6

Please sign in to comment.