2011-07-11 3 views
0

私のアプリケーションには2つのスライダがあります(左30%/右70%)。私は、ユーザーがタブレットを回転させると、左のスライダをポートレートで隠したいと思っています。左のスライダをポートレート表示で自動的に非表示にするにはどうすればいいですか?

可能ですか?もしそうなら、どうですか?

enyo.kind({ 
    name: "dashboard", 
    kind: enyo.VFlexBox, 
    style: "background-color:#FFFFFF;", 
    components: [ 

     {name: "header", kind: "Header", style: "background-color:#BDDEFF; height:57px;", layoutKind: "HFlexLayout", align: "start", components: [ 
      {kind: "ToolButtonGroup",style: "margin-right: 20px", components: [ 
       {icon: "images/menu-icon-refresh.png", className: "enyo-radiobutton-dark enyo-grouped-toolbutton-dark"}, 
       ]}, 

      {kind: "ToolButtonGroup", components: [ 

       {icon: "images/menu-icon-settings.png", className: "enyo-radiobutton-dark enyo-grouped-toolbutton-dark"}, 
       {icon: "images/menu-icon-edit.png", className: "enyo-radiobutton-dark enyo-grouped-toolbutton-dark"}, 
       {icon: "images/menu-icon-add.png", className: "enyo-radiobutton-dark enyo-grouped-toolbutton-dark", onclick: "addtask"}, 
      ]}, 

      {name: "vbutton", kind: "Button",style: "width:15%; margin-left: 20px; margin-top: 1px;", caption: "Hide Menu",onclick: "hidemenu"}, 

      {kind: "VFlexBox",style: "color:#5D5D5D; font-weight:bold;", flex: 1, align: "center", components: [ 
       {content: "Business"}, 
       ]}, 
      //{content: "Business",className: "enyo-item-secondary" ,style: "color:#5D5D5D; font-weight:bold;"}, 

      {kind: "ToolButtonGroup", components: [ 
       {icon: "images/menu-icon-edit.png", className: "enyo-radiobutton-dark enyo-grouped-toolbutton-dark",onclick: "edittask"}, 
       {icon: "images/menu-icon-add.png", className: "enyo-radiobutton-dark enyo-grouped-toolbutton-dark",onclick: "addtasklist"}, 
       ]}, 

      {name: "title"}, 
      {name: "description", className: "enyo-item-secondary"} 
     ]}, 
     {name: "slidingPane", kind: "SlidingPane", flex: 1, components: [ 

        {name: "left", dismissible: true, onHide: "rightHide", onShow: "rightShow", onResize: "slidingResize", width: "250px", kind:"SlidingView", components: [ 

Menu/List 
]}, 



      {name: "right",flex: 1, dismissible: false, onResize: "slidingResize",kind:"SlidingView", components: [ 

Menu related content 

]}, 

], 
}); 

答えて

0

まず、あなたのコンポーネントにこれを追加します。

{kind: "ApplicationEvents", onWindowRotated: "windowRotated"} 

ウィンドウを回転させると、次の関数が呼び出されます。

windowRotated: function(inSender) { 
    if(enyo.getWindowOrientation() == "up"){ 
    this.$.left.setShowing(false); 
    } 
    else if(enyo.getWindowOrientation() == "left" OR enyo.getWindowOrientation() == "right"){ 
    this.$.left.setShowing(true); 
    } 

} 
関連する問題