Luke Melia has created a repository that shows how to use Ember.js with the jQuery user interface.
The basics of the Luke example, I created a class JQ.Dialogthat represents the jQuery interface dialog box, see http://jsfiddle.net/pangratz666/aX7x8/ :
JQ.Widget = Em.Mixin.create({
...
});
JQ.Dialog = Ember.View.extend(JQ.Widget, {
uiType: 'dialog',
uiOptions: 'autoOpen height width'.w(),
autoOpen: false,
open: function() {
this.get('ui').dialog('open');
},
close: function() {
this.get('ui').dialog('close');
}
});
Then the dialog is created as follows:
var dialog = JQ.Dialog.create({
height: 100,
width: 200,
templateName: 'dialog-content'
});
dialog.append();
Ember.run.later(function(){
dialog.open();
}, 1000);
jQuery UI flame.js, / Ember.js. , . http://jsfiddle.net/qUBQg/:
App.TestPanel = Flame.Panel.extend({
layout: { width: 400, height: 200, centerX: 0, centerY: -50 },
isModal: true,
dimBackground: true,
allowClosingByClickingOutside: true,
allowMoving: true,
title: 'Test Panel',
contentView: Flame.LabelView.extend({
layout: { left: 20, top: 90, right: 20, bottom: 20 },
textAlign: Flame.ALIGN_CENTER,
value: 'This is a panel.'
})
});
App.TestPanel.create().popup();