我有兩個問題,Foundation Reveal和Ember.js。Ember.js和Foundation 4模式窗口
首先,行動「關閉」不是射擊。我有任何想法爲什麼。
#application.js
App.ModalView = Ember.View.extend({
templateName: "modal",
title: "",
classNames: ["reveal-modal"],
didInsertElement: function() {
this.$().foundation('reveal', 'open');
},
actions: {
close: function() {
console.log('close action fired');
this.destroy();
}
},
});
App.ApplicationRoute = Ember.Route.extend({
actions: {
showModal: function() {
var view = this.container.lookup('view:modal', {title:'Test title'}).append();
}
}
});
#index.html
<script type="text/x-handlebars" data-template-name="test">
<a {{action showModal}}>show modal</a>
</script>
<script type="text/x-handlebars" data-template-name="modal">
<h2> {{title}}</h2>
<p>Im a cool paragraph that lives inside of an even cooler modal. Wins</p>
<a class="close-reveal-modal" {{action close target="view"}}>×</a>
<a {{action close target=view}}>Close</a>
</script>
而第二個是,我不能來看一組屬性,同時增加這樣說:
App.ApplicationRoute = Ember.Route.extend({
actions: {
showModal: function() {
var view = this.container.lookup('view:modal', {title:'Test title'}).append(); //not setting title
}
}
});
對於第二個我不能在文檔中如何設置視圖參數發現,同時通過查找添加。
小提琴:http://jsfiddle.net/L4m6v/
什麼是正確的方式顯示彈出無路由? –
彈出窗口可能需要在應用程序模板中創建,然後使用css將其隱藏(關閉,或顯示:無)。然後你可以使用CSS在必要時顯示它。或者不要使用燼創建彈出。在我們的應用程序中,我們有兩者的混合體。這在燼寶生態系統中是一個棘手的問題。如果你不明白第一個,讓我知道,我會看看如果我可以爲你設置一個例子 – Kingpin2k
如果模態將有靜態內容,通過CSS隱藏它似乎是個好主意,但如果我需要動態內容(每個呼叫都是唯一的)我不知道如何實現這個... –