我想将一个Font Awesome图标附加到文本字符串中的最后一个单词:
foo bar?
Run Code Online (Sandbox Code Playgroud)
但是如果需要换行,我希望图标附加到最后一个单词并将它们包装在一起:
foo
bar?
Run Code Online (Sandbox Code Playgroud)
我的问题非常类似于: 阻止:从包装到下一行的元素之后
但是,解决方案假设我可以访问最后一个单词.就我而言,文本将动态生成.是否有一种css/html-only方式来确保图标包含最后一个单词?
这是一个jsfiddle.
我有多个复选框,其checked属性表示集合中的布尔值.我的代码正确跟踪复选框上的click事件并更新集合中的值.但是,当页面首次加载时,以及当用户离开页面时,尽管会话和集合值正确,但未正确设置checked属性.
HTML
<input type="checkbox" id="feedEmailSubscribe" checked={{isChecked}}>
Run Code Online (Sandbox Code Playgroud)
助手JS
Template.layout.isChecked = function () {
var id = $this.id;
return Session.get(id) ? "checked" : "";
};
Run Code Online (Sandbox Code Playgroud)
我首先下拉集合并通过'邀请'路线为复选框设置会话变量
// invites
this.route('invites', {
path: ':_id/invited-guest/VIP',
waitOn : function () {
return Meteor.subscribe('guests', this.params._id);
},
data: function () {
Session.set('guestId', this.params._id)
return Guests.findOne({_id: this.params._id});
},
action : function () {
var q = Guests.findOne({_id: this.params._id});
if (this.ready()) {
Session.set('guestName', q.name);
Session.set('feedEmailSubscribe', q.feedEmailSubscribe);
//...I then redirect the user
}
},
});
Run Code Online (Sandbox Code Playgroud)
我可以验证会话设置.这是我对设置路线(复选框存在的位置)的所有内容
// settings page
this.route('settings', { …Run Code Online (Sandbox Code Playgroud) 我正在使用Meteor的内置主机进行暂存,Codeship处理持续部署.所有测试和通知都在Codeship中按预期成功完成,但没有任何部署.
我的剧本:
expect -c "set timeout 60; spawn meteor deploy staging.myapp.com; expect “Email:” { send $METEOR_DEPLOY_EMAIL\r; expect eof } expect "Password:" { send $METEOR_DEPLOY_PASSWORD\r; expect eof }"
Run Code Online (Sandbox Code Playgroud)
当该脚本在构建过程中运行时,我看到以下内容:
spawn meteor deploy staging.myapp.com
=> Running Meteor from a checkout -- overrides project version (0.8.1)
To instantly deploy your app on a free testing server, just enter your
email address!
ail:
Run Code Online (Sandbox Code Playgroud)
这ail:不是拼写错误......这就是Codeship所展示的.虽然没有显示任何错误,但它最终会超时并继续前进.
首次设置CI服务器(并使用Expect),所以提前感谢您的帮助!
试图在Meteor - > Modulus上下文中绕过websockets和xhr.我有时会注意到很长的响应时间,显然是因为当无法连接时,websockets会回落到xhr ...我正在尝试诊断原因.
生产应用程序正在Modulus上托管.已启用SSL.
到目前为止我做过/检查过的事情
相对新手在这里,所以任何关于下一步检查的想法或建议都非常感谢.
BrowserPolicy.content.disallowConnect();
//
//Allow Meteor DDP Connections
//
var rootUrl = __meteor_runtime_config__.ROOT_URL;
console.log('ROOT_URL: ' + rootUrl);
//Allow DDP connections for local development
if (rootUrl == 'http://localhost:3000/') {
BrowserPolicy.content.allowConnectOrigin(rootUrl);
BrowserPolicy.content.allowConnectOrigin(rootUrl.replace(/http(s?)/, 'ws$1'));
}
//Allow DDP connections for staging server currently using Meteor's free hosting
if (rootUrl == 'http://staging.example.com') {
BrowserPolicy.content.allowConnectOrigin('https://*.meteor.com');
BrowserPolicy.content.allowConnectOrigin('wss://*.meteor.com');
}
//Allow DDP connections for Modulus
if (rootUrl …Run Code Online (Sandbox Code Playgroud) meteor ×3
css ×1
font-awesome ×1
html ×1
iron-router ×1
javascript ×1
modulus.io ×1
sockjs ×1
websocket ×1
word-wrap ×1