Skip to content

Commit

Permalink
#6214 add UIOptionsWidget, UIOptionsWidgetInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
piorek committed Feb 6, 2018
1 parent c537540 commit b261251
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

import * as $ from "jquery";
import { Widget } from "@phosphor/widgets";
import { IUIOptions } from "../BeakerXApi";
import { MessageLoop } from "@phosphor/messaging";
import { Messages } from "./Messages";

export class UIOptionsWidget extends Widget {
import UIOptionsWidgetInterface from "./UIOptionsWidgetInterface";
import IUIOptions from "../../Types/IUIOptions";
import {Messages} from "../../Messages";

export class UIOptionsWidget extends Widget implements UIOptionsWidgetInterface {

public readonly AUTO_CLOSE_SELECTOR = '#auto_close';
public readonly WIDE_CELLS_SELECTOR = '#wide_cells';
Expand Down Expand Up @@ -110,14 +112,3 @@ export class UIOptionsWidget extends Widget {

private _options: IUIOptions;
}

export class UIOptionsModel {

constructor(private widget: UIOptionsWidget) {

}

public update(options: IUIOptions) {
this.widget.onLoad(options);
}
}
21 changes: 21 additions & 0 deletions js/notebook/src/tree/Widgets/UIOptions/UIOptionsWidgetInterface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2017 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import IUIOptions from "../../Types/IUIOptions";

export default interface UIOptionsWidgetInterface {
onLoad: (options: IUIOptions) => void;
}

0 comments on commit b261251

Please sign in to comment.