This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setMinMax(self) { | |
var input_from = self.tags.from.root.querySelector('input') | |
var input_to = self.tags.to.root.querySelector('input') | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form onsubmit={ submit }> | |
<riot-period-input name="from" v={ from.format('YYYY-MM-DD') }></riot-period-input> | |
〜 | |
<riot-period-input name="to" v={ to.format('YYYY-MM-DD') }></riot-period-input> | |
<button type="submit" class="btn btn-secondary">決定</button> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isActive(period, type) { | |
if(this.period == period && this.period_type == type) { | |
return true | |
} else { | |
return false | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class={dropdown-item: true, active: isActive(1, 'months')} ...>今月</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onclick(e) { | |
e.preventDefault() | |
var period = e.target.getAttribute('data-period') | |
var type = e.target.getAttribute('data-period-type') | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('click', '.dropdown-menu', function(e) { | |
e.stopPropagation() | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = this.root.querySelector('input') | |
var now = input.value | |
if(moment(now).isBetween(input.min, input.max)) { | |
//新しい値に変更する | |
} else { | |
//元の値に戻す | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.on('mount', function() { | |
var input = this.root.querySelector('input') | |
if('ontouchstart' in window) { | |
// タップイベントがある場合にはinput[type=date]に変更 | |
} else { | |
// タップイベントが無い場合にはPikadayプラグインを使用 | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<riot-period></riot-period> | |
<script src="./javascripts/components/riot-period.tag" type="riot/tag"></script> | |
<script>riot.mount('*')</script> |
NewerOlder