Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
OwnedSymbols view before and after Rivets
생성일
10년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
35 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
50 행
복사
21 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
37 행
복사
var Radio = require('backbone.radio');
var Radio = require('backbone.radio');
복사
복사됨
복사
복사됨
var OwnedSymbol
Item
View = Marionette.ItemView.extend({
var OwnedSymbol
s
View = Marionette.ItemView.extend({
template: require('../templates/ownedsymbolitem.hbs'),
template: false,
tagName: 'li',
html
: require('../templates/ownedsymbols.
html
'),
className: 'item item-icon-right row',
modelEvents: {
'change:latestPrice': 'onLatestPriceChange'
},
events: {
'click': 'onClick'
},
onLatestPriceChange: function () {
var price = this.model.get('latestPrice');
var variation = this.model.get('latestVariation');
var variationText = variation ? Math.abs(variation).toFixed(2) + '%' : '--';
var iconClass = 'ion-arrow-' + (variation > 0 ? 'up': 'down') + '-a';
this.$el.find('.stock-variation').toggleClass('negative-value', variation < 0)
.contents().filter(function() {
return this.nodeType == 3 && this.textContent.trim().length > 0
}).replaceWith(' ' + variationText);
this.$el.find('.stock-variation i').removeClass('ion-arrow-up-a ion-arrow-down-a').addClass(iconClass);
this.$el.find('.stock-price').html(price ? 'R$' + price.toFixed(2) : '--');
},
onClick: function (e) {
e.preventDefault();
Radio.channel('navigation').request('goToPage', 'symboldetails', this.model.get('id'));
}
});
var OwnedSymbolsView = Marionette.CompositeView.extend({
template
: require('../templates/ownedsymbols.
hbs
'),
childView: OwnedSymbolItemView,
childViewContainer: '#symbol-list',
pageHeader: {
pageHeader: {
title: 'Carteira de Ações',
title: 'Carteira de Ações',
buttons: [
buttons: [
{
{
icon: 'ion-plus',
icon: 'ion-plus',
method: 'add:buy'
method: 'add:buy'
}
}
]
]
},
},
복사
복사됨
복사
복사됨
onBeforeRender: function () {
if (this.view) {
this.view.unbind();
this.view = null;
}
this.attachElContent(this.html);
this.view = rivets.bind(this.el, this);
},
onDestroy: function () {
if (this.view) {
this.view.unbind();
this.view = null;
}
},
onAddBuy: function () {
onAddBuy: function () {
Radio.channel('navigation').request('goToPage', 'newbuy');
Radio.channel('navigation').request('goToPage', 'newbuy');
복사
복사됨
복사
복사됨
},
onItemClick: function (e, scope) {
Radio.channel('navigation').request('goToPage', 'symboldetails', scope.model.get('id'));
}
}
});
});
module.exports = OwnedSymbolsView;
module.exports = OwnedSymbolsView;
저장된 비교 결과
원본
파일 열기
var Radio = require('backbone.radio'); var OwnedSymbolItemView = Marionette.ItemView.extend({ template: require('../templates/ownedsymbolitem.hbs'), tagName: 'li', className: 'item item-icon-right row', modelEvents: { 'change:latestPrice': 'onLatestPriceChange' }, events: { 'click': 'onClick' }, onLatestPriceChange: function () { var price = this.model.get('latestPrice'); var variation = this.model.get('latestVariation'); var variationText = variation ? Math.abs(variation).toFixed(2) + '%' : '--'; var iconClass = 'ion-arrow-' + (variation > 0 ? 'up': 'down') + '-a'; this.$el.find('.stock-variation').toggleClass('negative-value', variation < 0) .contents().filter(function() { return this.nodeType == 3 && this.textContent.trim().length > 0 }).replaceWith(' ' + variationText); this.$el.find('.stock-variation i').removeClass('ion-arrow-up-a ion-arrow-down-a').addClass(iconClass); this.$el.find('.stock-price').html(price ? 'R$' + price.toFixed(2) : '--'); }, onClick: function (e) { e.preventDefault(); Radio.channel('navigation').request('goToPage', 'symboldetails', this.model.get('id')); } }); var OwnedSymbolsView = Marionette.CompositeView.extend({ template: require('../templates/ownedsymbols.hbs'), childView: OwnedSymbolItemView, childViewContainer: '#symbol-list', pageHeader: { title: 'Carteira de Ações', buttons: [ { icon: 'ion-plus', method: 'add:buy' } ] }, onAddBuy: function () { Radio.channel('navigation').request('goToPage', 'newbuy'); } }); module.exports = OwnedSymbolsView;
수정본
파일 열기
var Radio = require('backbone.radio'); var OwnedSymbolsView = Marionette.ItemView.extend({ template: false, html: require('../templates/ownedsymbols.html'), pageHeader: { title: 'Carteira de Ações', buttons: [ { icon: 'ion-plus', method: 'add:buy' } ] }, onBeforeRender: function () { if (this.view) { this.view.unbind(); this.view = null; } this.attachElContent(this.html); this.view = rivets.bind(this.el, this); }, onDestroy: function () { if (this.view) { this.view.unbind(); this.view = null; } }, onAddBuy: function () { Radio.channel('navigation').request('goToPage', 'newbuy'); }, onItemClick: function (e, scope) { Radio.channel('navigation').request('goToPage', 'symboldetails', scope.model.get('id')); } }); module.exports = OwnedSymbolsView;
비교하기