コード例 #1
0
        /// <summary>
        /// 觸發一個 DOM 事件
        /// </summary>
        /// <param name="selector"></param>
        /// <param name="eventName"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public static TriggerContext RaiseEvent(this TriggerContext trigger, string selector, string eventName, object data)
        {
            trigger.Add("event", new FireEventPack
            {
                selector  = selector,
                eventName = eventName,
                data      = data
            });

            return(trigger);
        }
コード例 #2
0
ファイル: MessageExtensions.cs プロジェクト: wuanunet/MvcTrig
        /// <summary>
        /// 顯示訊息視窗
        /// </summary>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="type"></param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        public static TriggerContext Message(this TriggerContext trigger, object message, string title = null, MessageType type = MessageType.Info, int timeout = 2000)
        {
            trigger.Add("message", new MessagePack
            {
                title   = title,
                message = message.ToString(),
                type    = type,
                timeout = timeout
            });

            return(trigger);
        }
コード例 #3
0
        public static TriggerContext ModalOpen(this TriggerContext trigger, string selector = "#modal")
        {
            trigger.Add("modalOpen", selector);

            return(trigger);
        }
コード例 #4
0
        public static TriggerContext ModalClose(this TriggerContext trigger)
        {
            trigger.Add("modalClose", true, lowPiority: true);

            return(trigger);
        }