From c2a7902d0bf29d35cde9395002fd6c0eb1fe6fd4 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 15 Apr 2012 14:18:45 +0200 Subject: [PATCH] add 'open in new tab' button to example pages --- source/Ox.UI/js/Code/Ox.ExamplePage.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/Ox.UI/js/Code/Ox.ExamplePage.js b/source/Ox.UI/js/Code/Ox.ExamplePage.js index adac6246..36743707 100644 --- a/source/Ox.UI/js/Code/Ox.ExamplePage.js +++ b/source/Ox.UI/js/Code/Ox.ExamplePage.js @@ -23,6 +23,20 @@ Ox.ExamplePage = function(options, self) { .css({float: 'left', margin: '4px'}) .appendTo(self.$toolbar) + self.$openButton = Ox.Button({ + disabled: self.options.selected == 'source', + title: 'open', + tooltip: 'Open in new tab', + type: 'image' + }) + .css({float: 'right', margin: '4px 4px 4px 2px'}) + .bindEvent({ + click: function() { + window.open(self.options.html); + } + }) + .appendTo(self.$toolbar); + self.$reloadButton = Ox.Button({ disabled: self.options.selected == 'source', title: 'redo', @@ -58,6 +72,7 @@ Ox.ExamplePage = function(options, self) { change: function(data) { self.options.selected = data.value; self.$reloadButton.options({disabled: data.value == 'source'}); + self.$openButton.options({disabled: data.value == 'source'}); self.$content.animate({ marginLeft: data.value == 'source' ? 0 : -self.options.width + 'px'